The government faces criticism after announcing the rail franchise will be brought back under state ownership.