After some thinking, I've come up with a couple possible solutions to this issue. Feedback? (Eventually I'll make a thread in the modding forums.)
1> Currently, there are three +XP buildings for land units: the Barracks, Armory, and Military Academy. The Academy is insanely expensive, so I never bother. So, I was thinking: instead of just +XP, the Academy could also increase the number of "free" units your empire can support by 1. A few of these would apparently go a LONG way towards offsetting this problem.
In fact, I kind of wonder whether this wasn't the original idea for this building. It's just SO expensive that it kind of stands out.
2> Currently, there doesn't seem to be any benefit to some strategic resources once they're outdated, mainly Iron and Horses. So I was thinking: pay each player a token amount per unused unit (1 or 2 gold per), with the exact amount depending on era, resource, game length, map size, etc.; not enough to make up for not building a Factory/power plant, but enough to keep you making a profit.
(Or, I was thinking of creating a new Industrial building, the Steel Mill, that required Iron but added building production like the Workshop, to encourage people to use up their excess. The Stable could be changed the same way for Horses: once you're in the Modern era and no longer have mounted units to make, the building now consumes one unit of Horses and adds, say, 5 gold. It'd be easy enough to create a second building that requires the Stable but has this effect, say, the Racetrack.)