First hydrogen locomotive started working in Poland.
Biodiesels are still better than diesel and the stuff can be manufactured from seaweed, algae, any biomass really. It doesn’t have to be a monoculture. It doesn’t even have to be 100% biodiesel either - start blending it in. I agree electric motors and electrification are the ultimate outcome but the rail industry has a lot of lines and a lot of locomotives and and you want progression over time with options for battery, power lines or diesel, potentially all 3 on the same line in different parts. It might take decades to transition. It’s certainly not hydrogen, that’s for sure.
In support of your point, and to help clarify it, there’s a lot of train lines where the cost (and the carbon output) of electrification is far beyond the benefit. A lot of the North Wales coast, for example, because working in the tunnels would be prohibitively expensive. In these cases it makes sense to have bi/trimodal trains, at least until electrification technology makes significant breakthroughs.
Another example might be cases where an old rail line (e.g. ex-mining) is looking at being reopened at a low capacity. It would be madness to immediately electrify. An example I have looked at was running a train for tourists on what is currently a little-used freight line (that still uses tokens!) in the Lake District.