Booking Sri-Lankan Train Tickets Online
The Man in Seat 61 says that to date the only tickets that are bookable online are those for the ExpoRail and Rajadhani carriages for the Colombo-Kandy-Badulla journey. The regular trains cannot be booked online (quoting from The Man):
How to buy tickets...
- The privately-run ExpoRail & Rajadhani carriages Colombo-Kandy-Badulla can be booked online at www.exporail.lk & www.rajadhani.lk.
- The regular Sri Lanka Railways trains cannot be booked online, but it's easy to buy tickets when you get to Sri Lanka at the station. In Colombo, there is a special ticket window for tourists in the 1st & 2nd class advance booking office at the east end of Colombo Fort station.
Since you wish to travel on the Colombo-Kandi stretch, you'll be able to book that part of the journey on the Rajadhani in advance. Here is the official webpage showing timetables, costs and online booking procedures. If you'd rather take the InterCity train, then you'll have to go to the ticket office in person or send someone on your behalf. Also note that reservations open 45 days before departure (quoting from The Man):
- Reservations for trains with reserved seating such as InterCity Express trains open 45 days in advance (extended from 10 days in late 2013). Seats in the 1st class observation car from Colombo to Kandy can get fully-booked from time to time, so book a few days ahead if you can, but you may well find seats available on the day of travel. Other trains (shown as having unreserved seats) don't require a reservation, you just buy a ticket on and hop on.
Purchasing Tickets in Advance
The Man in Seat 61 suggests one possible alternative to online booking: using local travel agencies. The linked site has a few agencies listed. Note that these will obviously charge a fee for the booking.
Gagravarr suggests to call your hotel and ask them to send someone to purchase the ticket on your behalf. This is also a valid option, which will probably require you to pay an extra fee to the hotel, or at least tip the staff. The Man also mentions this on the linked page.