Hydrogen is not a good choice of fuel for trains, just like it is for cars and trucks.
Nearly all hydrogen is produced using the “Steam Reformation” technique that involves water and fossil fuels. They use mainly natural gas but also coal.
This process creates significantly more CO2 than the burning of diesel fuel.
This is a terrible way to power a train or any other object )… it would make global warming significantly worse, not better!
Another way to make hydrogen is by using huge amounts of electricity to electrolyse water. This produces a lot of waste heat and is very energy-intensive.
It is not the best way to create zero-emission trains.
It is much better to use overhead wires for all-electric trains. This technology is not new. All-electric trains have been in use for over 50 years in the UK, Europe, and Japan. This is an Indian electric goods train.
It doesn’t matter from where electricity is sourced, it is cheaper and more efficient to use it to drive electric train drivers than to waste it on hydrogen production by electrolysis.
This is the only problem. However, you will need to replace all your locomotives when switching to hydrogen fuel.
Diesel-electric locomotives, which are most commonly found in diesel engines, use diesel engines to generate electricity that drives electric motors. This is much like a hybrid car. To “go electric”, you simply need the contraption to pick up power from the overhead cables instead of the diesel engine.
This allows you to use the overhead cable technology only on the busiest routes, and then slowly add it to all other routes. You can gradually reduce your use of diesel.
It will be much cheaper to add overhead cables than to replace all your locomotives and install hydrogen storage/filling stations along the tracks.