The journey to Yogyakarta by train from Jakarta is a great experience, which could last from 7 to 12 hours according to the train you have selected, to cross the 600 kms (or 375 miles) between the two cities. When you arrive, late afternoon, at night at the Tugu railway station, the first contact is still the same than some decades ago, as it is related by Harold Foster in his novel 'Flowering Lotus":
The train crossing the jungle before arriving in Yogyakarta.
" At last, through the heavy tropic darkness, our train came gasping into JOGJA. That was how the name of our destination was spelt on the outside of the carriage, and that was what it was always called, through the correct form was Jogjakarta, or Djokjakarta, or even, in the full Javanese version, Ngajogjakarta, while Raffles in the History of Java (1817) spelt it Yug'ya Kerta. The popular abbreviation, informal and universal, was a sign of the place it held in the affections of the people - Jogja, the stubborn city of the Sultans, the sanctuary of Java's ancient traditions, the cradle of Indonesia's freedom."
(Harold Foster, Flowering Lotus)
The Tugu railway station by night.