Well it depends how you start. Lets assume WW1 occurred but Germany did not become full on Nazi. So no war in Europe.
There was a general election in 1935, so the next one would have to be before 1940. The 1935 election led to a coalition but the Conservatives were the main party, and could have formed a government without coalition.
Whether WW2 caused Labour to win the 1945 election I dont know. But without a labour government, I think nationalisation of rail, steel and coal would be unlikely.
Without WW2 we would not have needed assistance from the United States. So the empire would have lasted longer, but I doubt it would have lasted much longer. Maybe our exit from India would have been less rushed, and maybe we would not have seen partition there, so a united secular India, and no Pakistan/Bangladesh. Empire was important as the rail equipment industry exported equipment to the colonies, improving its viability.
But as described earlier, there were massive leaps in technology in WW2:-
Big diesels were developed for marine use, notably the Deltic. This allowed diesel railway locos with a decent power/weight ratio.
Turing and Flowers developed the first electronic digital computer - colossus- at Bletchley Park. Would we have had TOPS, or APTIS without Colossus. or even the electronically controlled power electronics we have today.
The big unknown for me is electrification. Would the railways have carried on with 1500V DC electrification? or abandoned it as unaffordable. would we have seen Bournemouth and Kent Coast 3rd rail? There there advances in power systems in WW2 that helped. Were the motor generator sets replaced by mercury arcs because of WW2 technology? Without electricity nationalisation would supply of bulk electricity to the railway have been possible? Before nationalisation, much of the electricity industry was local authority owned, and was important for tramways.
Without electrification and diesels with sufficient power, then steam would have still been the mainstay.
Of course without WW2, then we could have shared developments with the big industrialised economies, like Germany, France and the US, and that will have affected UK railways.
Or then we could have had a Beeching/Serpell type rationalisation with just the main inter city routes, plus a london surburban railway, maybe doing their work in about 1950 as cars and lorries became a realistic form of transport.