From my understanding of the period the suggestion that the Attlee government nationalised the railways because it couldnt afford the payments to the railway companies for their war work is not borne out by the evidence.
The Labour Party won a landslide victory in the 1945 General Election on a manifesto which called for the taking into public ownership the commanding heights of the economy. This manifesto pledge was based on Clause IV of the Labour Partys constitution which stated, in part
To secure for the workers by hand or by brain the full fruits of their industry and the most equitable distribution thereof that may be possible upon the basis of the common ownership of the means of production, distribution and exchange, and the best obtainable system of popular administration and control of each industry or service.
In 1942 the annual Labour Party Conference, with an eye on its constitution, passed a resolution urging the Government to coordinate road, rail and canal transport under national ownership - with the aim of aiding the war effort. National ownership remained the Labour Partys policy after the 1945 election and the Attlee government then nationalised about a fifth of the economy - coal, railways, road transport, the Bank of England, civil aviation, external telecommunications, electricity, gas and steel. It created the Welfare State by setting up the NHS, thereby nationalising the hospitals, setting up National Insurance in 1946 and created a safety net by the National Assistance Act of 1948.
The nationalisation programme was led by Herbert Morrison who in 1930 had proposed uniting London's buses and underground into a centralised system under public ownership. (There had been discussions for years previously about consolidating Londons transport, but into a private company so the idea didnt come out of the blue). The London Passenger Transport Board was created in 1933. Post-war, Morrison started with nationalising the Bank of England in April 1946 compensating stockholders with Government bonds yielding, IIRC, 3%.
Further industries followed: civil aviation in 1946, railways and telecommunications in 1947 and the National Coal Board. By 1951 the iron, steel and gas industries had also been brought into public ownership. For all of these the existing shareholders received Government paper in return which essentially guaranteed a dividend.
So, the Labour Party had committed itself to nationalising the railways by 1942 before the extent of the excessive wear and tear due to the war effort could have been known. In addition, paying compensation to the shareholders of all these industries cost a lot of money - so the idea that the Government could have saved money by not paying compensation to the railway companies doesnt stand up to scrutiny.
There is a curious twist to this story. In the event, the Attlee government had no money (for reasons which could fill a book!) and had to go cap-in-hand to the Americans in 1946 for an emergency loan of $3.75 billion (in then dollars). The Canadians chipped in a further billion. Nominally the loan was to cover post-war overseas expenditures, but as the Government could only have afforded the nationalisation and the welfare reforms if it withdrew from all of its overseas commitments immediately, essentially these were funded by the Americans. The final repayment of the loan was made in 2006.