I think Old Timer has written somewhere on this forum in great detail that shows the railway has always done better under a Tory Government, even if the unions would clearly prefer Labour in control.
I think even now, we can see that under the coalition, rail has and will benefit greatly in the coming years.
The programme did quite clearly show just how bad BR had become as a nationalised company, with poor management. Who knows if it could have continued to grow and improve had John Major not instigated privatisation.
In reality it's all very complex, and governments of all shades have been good and bad to the railways.
The height of the railways in the UK was around 1840-1919, a period of Liberal and Conservative governments. Beyond that, there were a few bright spots, arguably the early 1950s with the modernisation plan (although the railways had little traffic growth during this period, and some decline) that came under a Conservative government. 1987-1994, when traffic rapidly picked up, again a Conservative government. And beyond 2002, initially a Labour government then a Conservative led coalition.
Bright spots for Labour was the Transport Act of 1968, which brought in the PTEs, which arguably did some good for urban rail.
The darkest periods were during the 1960s with the Beeching plan, Conservative led, but carried out by Labour. Also much forgotten was the Branch line closures committee of 1949, under a Labour government.
Most Labour governments tend to focus on Health and Education, and the Blair government tended to favour buses, which are used by core Labour supporters. Whereas one of the reasons Cameron supports rail, is trains, by and large (although not exclusively) tend to be used by core Conservative and Liberal voters. The Tories have tended to support business, and on the whole of have more interested in infrastructure compared to Labour, something business (as well as low tax rates) is very keen on!
The rail Unions tend to support a Labour government as they are by and large left leaning, although the RMT tends to be hard left. The Unions movement of course has a long history with the railways, the Trade Disputes Act of 1906 (which meant a Union could not be sued) was tied up with the Taff Vale Railway. The Labour party itself pretty much owes itself to the Amalgamated Society of Railway servants (eventually the NUR, and now the RMT), in particular Thomas Steels, a Doncaster Signalman, who called for an independent party of Labour around 1899.
At that time, conditions for some workers were poor, the Cambrian in particular was famous for it's very long hours. In the post war period, under Labour the Unions became ever more powerful and through strikes and restrictive working practices arguably did an awful lot of damage to the railways, traffic left never to return especially in 1955 when a state of emergency was called.
I think Thatcher regarded the railways and the Coal mines as hot beds of socialism (the two industries of course heavily linked) which is probably why she disliked them, even though her core voters are, and probably mostly always were, their main customers.