Other than the TOCs, the rail network was renationalised almost 20 years ago. If the Labour, Coaliton and Conservative governments in that period wanted to prioritise electrification they could have done so. I suppose Labour was the worst party of government for electrification.
Network Rail was only formally brought back into the public sector in 2014, and it took some time after that before DfT took real control of its finances.
Until then it could, and did, borrow on the commercial market for enhancement projects like WCRM, Thameslink and electrification.
The Treasury shut those doors (aka "cut up NR's credit card") and capped NR spend to its formal budget, hence the suspension/cancellation of some capital projects.
Nationalisation (in the sense of limited public funding) is not necessarily the answer to the railway's needs.
Labour spent a lot on the railway but much of it was invisible to the public (eg TPWS roll-out).
They also gave us HS1, kicked off Crossrail and HS2, and authorised GW and NW electrification (delivered in Tory years).
There was no industry demand for electrification - the TOCs were too busy ordering new diesels which could be delivered quickly.
The mantra was: "Passengers just want a seat, and don't know or care what powers the train".
Things changed from about 2007, when industry and government both shared the desire for more electrification.