Whilst I am reluctant to suggest any argument against electrification, I really cannot think of circumstances that would justify the electrification of the likes of the West Highland of Far North Lines.
An edge case, however one that would need a solution - it may well be that it's something other than battery. However even if it was Hydrogen, that's not a good reason for it to be used elsewhere.
Given the weather the WHL can experience, I can't see electrification being reliable even if it were fitted.
Taking the example of Dawlish: given how often the sea wall at Saltcoats is closed to electric traction, how resilient would an electrified Dawlish be?
It's the sort of thing where batteries could work.
So I believe there will always be a requirement for some portable energy and batteries have their limits: I go back to WHL: how far does battery technology need to evolve until it would be credible to hop between power sources, accepting that much of the line is some distance from the sort of electricity supply that would be required for flash charging?
Indeed, however these sorts of lines tend to be few and far between, as such, even if hydrogen is useful for them they are going to be limited in number.
One thing which could work, is the use of line side batteries being charged from little more than a household supply to then provide a lot of power when there is a train passing as it's not all that frequent.
Hydrogen is no panacea, but may be required to bridge gaps - literally.
If you're referring to bridging the gaps caused by bridges, a battery with a range of 1 mile could be plenty large enough to get a train passed those bridges which are too constrained to provide OHLE.
Alternatively maybe the trick is to decarbonise everything that is practical and then accept that a few marginal edge cases simply cannot be economically decarbonised.
That may be the case. However that then means more of "other" carbon reduction (carbon capture and storage, tree planting, etc.). These tend to come at a cost, and currently there's an argument that we are using such things too much (or want to use them too much).
Arguably, of we had a scheme where we were building rail to allow the reduction of the road network and/or internal flights (so overall travel remains broadly the same but lower in carbon emissions) then actually small areas where carbon emissions were higher than they needed to could be broadly acceptable.