Yes, you can travel to Shimla by the Kalka-Shimla rail line. The narrow-gauge tracks are 94km long and start from Kalka in Haryana. There is a total of 5 trains which ply between the two stations and take between 5 to 6 hours to complete the journey.