Losing passengers will endanger thousands of rail jobs, the transport secretary says.