There are two main train companies in Peru, Inca Rail and Peru Rail. Both are clean, comfortable and modern. Of course there are varying levels of service and amenities. The relatively short train from Ollantaytambo to Aguas Calientes (about 1 1/2 hours) goes through some lush, beautiful areas, often along the river.
The longer train from Cusco to Puno (Lake Titicaca) goes through a long valley for 10-12 hours. It is scenic in a different way however to break up the monotony, they have some staff play music, do local dances, and have a fashion show (merchandise for sale, of course!). The food was excellent on this train and you have white table clothes, wine, etc.
While trains are more expensive than buses, they are faster and more comfortable and still relatively affordable. The train from Ollantaytambo to Aguas Calientes was under $200 each way for the two of us and from Cusco to Puno, $450 for the two of us, including meals and entertainment.
The trip to Aguas Calientes is much lusher and (IMHO) more beautiful but we enjoyed the trip to Puno as well.