Personally, I think hydrogen as fuel will be confined to a "special situations" niche, I can't see it being a mainstream solution for the rail industry.
If you're going to make green hydrogen, there's a stack of things against you
1. The "surplus electricity" thing will not happen as often as people think as EVs and electric heating could lead to a tripling of electricity demand by 2050
2. You then have electrolysis and compression losses to make it a usable fuel at very high pressure, making it look expensive compared to power
3. Rail would depend on other users (far from certain) to roll out a national hydrogen infrastructure to get fuelling points (or will it be trucked around?)
4. Need to solve all the fuel storage issues on the train
5. The train is still likely to be dependent upon batteries for peak power and regenerative braking.
Batteries plus discontinuous electrification could be what "electrification" looks like in 10 years.
The bits of electriciation that are done are basically a BEMU charging infrastructure. This means the range doesn't have to be a whole day/hundreds of miles between refuelling, but tens of miles across gaps in the wires. This instantly knocks down the energy capacity requirement by a factor of ten, and the weight penalty for batteries is down to a few tonnes per vehicle.
Of course this has implications for ensuring capacity of the wires and substations to deliver that current, but even so, sounds cheaper than all the piling and structural works to get conventional electrification to every mile of a route.