Once you arrive in the city of Cusco, it is advisable to buy the tourist train ticket; the purchase is personal. You can buy it personally or with a travel agency to accompany you and tell you more safely. Among them are Train Expedition, Hiram Bingham, and Vistadome. Prices from 65USD to 930USD.
For SCHOOL TICKETS and FOREIGN STUDENTS, visit http://www.machupicchu.gob.pe/items/estudiantes.html. There, you will find all you need to know if you are a student.