Whether a mon that does higher DPS or one with better survivability is "better" is something you have to choose for yourself. If you are trying to solo 3* bosses you are likely to be very dependant on DPS (higher attack mons). If you can use a combination of good attack and survivability for raids in your area then a mon with good attack stats and defensive stats may be better. No one can really grade such things as they are very particular to your situation. I know that for my situation Jynx would be tough to justify powering up. For you it could be very different.
In most cases gyms should be a lower consideration for usefulness as for most folks time or even potions may not be an issue. And gyms simply are not anywhere near as hard as they used to be. The real challenges that demand dust expenditures in most cases are in raids where limited time or required damage for limited numbers is a unavoidable consideration.