It is easier in the future to replace a diesel generator, than a pure diesel with hydrogen power in the future, once that technology has been proved.
You maybe be surprised. Without seeming like being devil's advocate, as much as yes infilling 3rd rail would be the logical answer, for me there has to be some reason why it has not been done in the last 30 - 50 years other than cost.
There has been trackwork I believe on the routes that are served by the class 171's, why did that work not include implementing 3rd rail infill if it is the easy logical answer?
I would be very surprised as there are plenty of facts and reasons:
a) For the last ~20 years the safety case has presumed against it, this is currently being re-analysed
b) BR and later BR era Network South East had a priority list (NSE pulled off 16 schemes in 11 years)
c) Some key BR 3rd rail electrification dates:
(go live dates)
Tonbridge - Hastings 1986 - 35 years ago
Sanderstead-East Grinstead 1987 (couldn't make business case of Uckfield then as no second hand units available that fitted on the branch) - 34 years ago
Poole - Weymouth 1988 - 33 years ago
South Hampshire gaps (Southampton - Eastleigh - Portsmouth) 1990 - 31 years ago
Redhill - Tonbridge 1994 - 27 years ago (Channel Tunnel funding)
d) electrification was then mosty paused in the run up to privatisation to make Railtrack's costs look good in the 2 years before hand. The exceptions being Heathrow (OHLE) and Clapham Jn - Kensington Olympia (1996)
e) The SRA and later ORR were then formed and the safety case went against it.
f) The remaining Network South East list from 1994 when electrification was paused (apart of from Clapham Jn - Kensington Olympia which was approved)
Ashford - Hastings (3rd rail)
North Downs (3rd rail)
Hurst Green Uckfield (3rd rail)
GOBLin (OHLE)
Bedford - Bletchley (OHLE)
Marks Tey - Sudbury (OHLE)
Basingstoke - Reading (3rd rail)
Basingstoke - Salisbury (3rd rail)
The next items on the list still are mostly still the next items on the list, GOBLin has been done and Basingstoke - Reading would be OHLE now.
The NSE thinking was that Thumper replacement would be enough to help justify Uckfield when the time came (but Southern bought the 171 instead)
Hopefully this is a bit clearer?