Which to power up really depends on your playstyle & what's your objective? Whether you wanna destroy gyms for fun or defend gyms as long as possible to collect coins. Whether you play solo or in group.
Separate your Pokemons into 2 team. Team Attacker & Team Defender, Attackers are used to destroy gyms while Defenders are used to park in gyms.
In the Attacker team, the key is to have a variety of move types so that you can take advantage of the enemy Defender's weaknesses. Also, as mentioned before, get those "ultimate" charged move e.g. Solar Beam, Hydro Pump, Fire Blast, Thunder, Moon Blast, Hyper Beam etc. But that is also personal preference, some people may argue those "ultimate" charged moves isn't the highest DPS. I hate the charge move animation, it spoils my dodge tempo. So I prefer to have 1 powerful charge move instead of multiple weaker charged move.
In the Defender team, the key is to have the highest CP possible to sit as high as possible in the gym. So that when enemy team attack, your Defender won't be the early ones to drop out. I'm referring to those level 7 to 10 gyms that can actually hold against solo players (unless the solo player is really rich in resources). Check the ranking
HERE to see which are the top Pokemons in terms of CP. Not many actually; Dragonite, Snorlax, Lapras, Arcanine, Exeggutor, Vaporeon & maybe Gyarados only. So technically, your Defender Team should consist of those only if you wanna sit comfortably on top of the gym.
For me, I like taking down gyms in groups & defend my level 10 gym as long as possible for ez 10 coins. Based on that kinda style, I power up my Attacker Team first. For my Attacker Team, I power up just enough to reach CP2k & that's about it. When attacking in groups, I have other players to back up my weaker attackers anyway. So I don't see the need to go up to CP3k at the moment. Now that I have a somewhat solid Attacker Team, I'm focusing to build my Defender Team. I'm only powering up those top CP Pokemons with high IV (high IV = more CP) just so that they can sit at a higher position in the gym.
So, what kinda Pokemon Trainer are you?

There is the Trainer variant of the Gym Defender.
The key is having lots of pokemons with different attacks at every 100 CP level. So when it comes to raising gym prestige, I'll pick a pokemon with CP just below the defending pokemon but with an attack that takes advantage of it's weakness. This way you gain 500+ prestige per battle and raise the gym level quickly.