We traveled in October 2016 between Budapest to Bratislav and then to Prague. We purchased our tickets the day of travel, except in Budapest. Due to the refugee crisis, ticket purchase in Budapest was slow and we purchased our ticket the day before. We had no difficulty getting tickets in Bratislava for our next train. We used a local train and traveled second class. Easy to do, without booking in advance.
One word of advice. Many of the compartments were occupied and we would prefer a compartment to ourself. Many compartments were empty because they had reservations for legs subsequent our destination. It would appear that many people assume that if a compartment is reserved they cannot use it. We had a compartment to ourself. While some people would want to mix with other traveller, the compartments are small and people traveled as groups.
Trains are efficient if traveling point to point between cities, but can restrict your ability to be spontaneous.