The trains in Indonesia are generally safe and comfortable and can provide an unique view of the country. There are some things to consider before booking your train ticket.
There are three train classes: Ekonomi, Bisnis and Eksekutif. Ekonomi does not have guaranteed seating and has no airconditioning. With Bisnis you do reserve a seat but there is still no air-conditioning (there is no comparison possible with the Business Class flight tickets, besides the name). Eksekutif class has spacious seats and airconditioning. Be aware thought that they will put the AC on max and it can be very cold inside the carriage.
The scheduled departure times are more "around" times: trains are notoriously late and best to always take into account 10 to 20% extra scheduled travel time. But sometimes they are early so best to be at the station well in time. On most stations are shops and restaurants where you can buy snacks and drinks for on the way. Although you can also buy it in the train, it is way cheaper to buy it beforehand.