25kV railway electrification is normally very separate from local electric grids.
Grid ‘reliability’ issues are normally load shedding or damage at the distribution level; the 10-22kV local networks. DC networks like third rail and 1500V are often supplied from local substations.
Long distance 25kV lines are almost always fed directly from big substations on the grid backbone - here in NZ, they’re all from the 220kV substations at roughly 140km spacing; I believe in the UK it’s almost all from 400kV subs. Those are extremely reliable and well monitored because no-one wants to be doing a grid black start, and loss of a grid backbone substation gives you a pretty good chance of the whole grid falling over. 25kV railway electrification is rock solid.
NZ’s grid is roughly 93% efficient; half of that is in the transmission (long-distance) and the other half in distribution. We have one of the worst grid layouts for transmission efficiency because most of the generation is in the deep south while the load is in the north, with an underwater section in between.
Batteries and charging is IIRC around 90% efficient, round trip. Call it 75% from generator terminals to motor terminals.
If you’re not generating the hydrogen right at the generator, you’ll also be incurring grid losses to get the power to the hydrogen plant.
If you are generating hydrogen at the generators, you’ll then need to transport the hydrogen even further. I’m struggling to find exact figures for losses in natural gas networks, but my understanding is that leakage is several percent. Any large-scale hydrogen system could end up being similar, plus you now need a shipping industry to move the hydrogen to the point of consumption.