The closest railway station to Sigiriya is Habarana, 15km away. There’s only one train that runs back and forth daily, so this makes things a little inconvenient unless you plan your trip accordingly. Note that taking the train is the slowest way to get there.
According to Fort Railway Station, a reserved 3rd class ticket costs Rs. 480 while a reserved seat in 2nd class costs Rs. 600. That’s a little pricey considering the travel time and convenience when weighing out your options.