The first three railway companies to be nationalised have been named as part of the new Labour government's plan to bring rail into public ownership.