SO what your saying.
-Air tank hold air.
-Air then drives pistons to move wheels.
-Wheels move locomotive pulling cars
-One set of wheels on the "tender" generates power.
-Power is used to run a compressor.
-Compressor fills air tank.
-Rinse and repeat.
On paper its a sound idea, but lets look at where it goes wrong in the real world.
You could generate power from the motion of the wheels on the tender, in fact, many cabooses did this. But here's the down side, they only generated a small amount of power. Not the massive amounts you'd need to run an air compressor.
Lets also look at another thing you may have over looked, resistance. And rolling resistance. As you try to generate more power from your generating axels, the higher the load on the generators, meaning you'd need more power to turn the wheels. This means you need to work harder to spin them, this means you need to build more air, this means you need to run the compressor more, this means you need more power, this means you need to spin the wheels harder, this means you need to work harder. This just keeps going up exponentially until you hit the speed of light, or run out of air.. But there is a math formula out there that deals with this.
But the idea that the more power you want, the hard the wheels become to turn is a proven fact. Look at dynamic breaking on locomotives. The wheels spin generating power. This power is feed into large resistors. This is much the same has you holding your garden hose and kinking it to slow the flow of water. These slow the flow of electricity making it harder for the wheels to turn.
So you'd need more power then you could generate from the wheels to run the compressors. And before you think to add more wheel's, that just means you have more rolling resistance meaning more power is needed to pull the train, meaning you run out of air faster and have to run the compressors more.
The only way this would be efficient and would generate more power then it consumed is if you rolled the train down a hill. And then you run into the problem of getting back up the hill. At this point running the train down the side of say a large hill, or mountain and storing that power in the form a batteries. The removing all the heavy cars with power generating wheels and having just one car with the compressor and battires to take just the locomotive back up the hill would work. But then how do you get your power generating wheels back up the hill?
What you are suggesting, is perpetual motion. Or "Free energy." And as we know from 6th grade physical science energy can not be crated or destroyed, only transferred.