Such a thing would be way more fit for a console game if you ask me. Adding gym fights to such a plot just doesn't feel right right. "Hey, I know we're being oppressed by an evil team right now, but you should just pretend like we aren't, and go become a pokémon master by earning gym badges!" It's like taking a citytrip 'round Europe during WWI.
Perhaps the Gym and the E4 challenge could be the done after you free the region from the evil organisation?