India has a great railway network for getting around the entire country and we were counting on it during our time there. There are two websites you can use to book your tickets online: Indian Railway Catering and Tourism Corporation and ClearTrip. I prefer ClearTrip because although there is a small service fee to book with them their website is much easier to navigate. It's clear! One thing I didn't expect was how far in advance you need to book your train tickets. They fill up quickly so the sooner you book the better if your plans are not very flexible.
It can get confusing because as they get filled up, they dish out RAC (reservation against cancellation) and Waitlist spots. In addition to that, there are also about 8 different classes of seats/berths for you to choose from with varying degrees of comfort levels. The blog Seat61 is a great resource for breaking down the concepts of Indian Railway travel. It also explains how to book Indian Railway tickets online without an Indian mobile number since one is required to register with the online booking sites.
Another hurdle when booking trains in India is that the two booking websites mentioned earlier cannot build an itinerary with connections for your travel. That is to say, if you wish to visit Rishikesh from Agra, you have to book each leg of that journey separately since there is no direct route between Rishikesh and Agra. So when building itineraries that involves train transfers, I recommend the site IndiaRailInfo for gathering your booking details. It has the most accurate and descriptive travel information for the Indian Railway that we have found thus far. Then you can use one of the two booking sites to actually purchase the tickets online.
Once you figure out the system though, the traveling is easy. Trains have departed on time in our experience (except for one which departed an hour late but miraculously still arrived at the desitation 5 minutes early) and the tickets are extremely affordable. it beats the hassle of flying any day!