Problem: AI not upgrading units.
Reason: Some upgrades require resources, which aren't needed for original unit.
Maybe it is time to discard the BoardGame style of military units and ressource requirements and realign with the real world. Military units consists of soldiers and specific equipment. If you upgrade a unit, you replace old equipment with new one. You can develop and manufacture military equipment on your own, but usually military equipment is also available on the world market/black market or from friendly nations, e.g. many nations do not manufacture military equipment but instead buy equipment manufactured in Russia, China, USA, GB, Germany, ... Research and production of military equipment like tanks and planes is usually very expensive and the demand per nation is rather small (hundreds to thousands) compared with numbers of cars produced/sold per year (hundredthousands to millions). Military equipment is very expensive but without production for the international market, it would be even more expensive to maintain a national military-industrial infrastructure.
When military units are upgraded, the old equipment is often sold on international market. Access to resources like iron/steel might be a requirement for manufacturing certain weapons but should not be a requirement to possess/use such weapons.
Plain infantry should be cheap to set up. Today a rifle may cost about 1.000 $ but a soldier may cost 50-100.000 $ per year (in western world professional standing army). If a nation has not the means to upgrade outdated units, it might be cheaper to retire them or change them to plain infantry with rifles from market. There are many hundred millions (maybe even a billion) of small arms available on our planet these days.
In a true simulation game, you could only buy stuff from market which has been produced in the game, e.g. by your own or other players' cities. In Civ games (if you have enough money) it is possible to research a new military unit and buy it in all your cities in the same turn, even if the city was founded in the same turn and is isolated on the other side of the planet. Even when your strongest city would need 10 turns to produce a single unit and you are the only nation having discovered the tech for it so far in the game. Civ games are very inconsistent regarding production. It is possible to set up a gold economy where all cities in the game specialize on making money and do not produce any stuff like buildings or units and players are still be able to buy these things from an invisible market. Since all cities specialize on gold (consumer goods), they cannot have produced the buildings and weapons so where does it come from?
It is a different matter with energy resources like coal or oil used as fuel for modern units like ships, trains, tanks, cars, planes .... These resources limit mobility of armies / fleets. Therefore it would be a good thing to be able to buy fuel from market and stockpile a reserve for war if you do not own the resource tile yourself. Lack of oil however should not prohibit you from manufacturing modern weapons, the units are simply less mobile or immobile until you get some more oil from market/conquest ...