[1]https://www.power-technology.com/news/man-ammonnia-engine-te...
[1]https://www.power-technology.com/news/man-ammonnia-engine-te...
Rail networks with large stretches of non-electrified lines are extremely costly to upgrade, so battery-electric and hydrogen are the likely solutions unless there is massive investment in electrification. The US, Canada, Mexico, Brazil, Argentina and Australia are prime examples of this.
Currently CPKC is working on a number of HFC locomotives that are showing very promising results.
Why would that be, except maybe in rare cornercases? You can electrify almost anything, and it'll be more efficient and less polluting.
For transit use, a rule of thumb is if you have a bus every 10 minutes or less then it would be more cost effective in the long run to have wires to the bus (better than diesel or battery buses). However even when you have a bus every 10 minutes odds are you have enough other routes that don't have that frequency and so overall it isn't worth it even though in some places it would be.