When travelling in Sri Lanka using public transport, tourists are often recommended trains where possible instead of buses, though bus journeys have their colour and charm. The reason for this is that while it is more comfortable, the rail system in Sri Lanka is set in a way where you can get some of the best views of the country, simply by hanging out your window on the way. There are only very few railway lines so you can't go everywhere. But whenever you can, opt for a train journey where possible.
Buses in the meantime are a great way to experience locals going about their business and if you want to explore the country from a local's POV this is the way to go. Keep in mind that it will be crowded and raucous but that is part of the charm.