For years the world's railways have steadily declined. Now trains are facing their biggest revolution since the discovery of steam and the age of the Iron Horse.