>>1957178It's lost along the way - coal fire makes hot air, hot air heats up water, water turns into steam, steam gets all pressurised inside the boiler until it's powerful enough to turn the wheels, then the used-up low-pressure steam is mixed along with the hot air exhaust and blown out the chimney.
It's *possible* to recycle the water, they experimented with it on early London Underground trains, but for one reason or another it never really caught on. When you drag your coal and water along behind you anyway, it's easy enough to fill up the tank again at stations, or along the way with a big scoop.