NEW DELHI—A burst of investment in India’s railways in recent years brought high-speed trains and modern technology to a colonial-era system, but did far less to repair old tracks, improve safety and ...