is it possible to buy tickets from Budapest Nygati railway station to Graz,Austria....?
Click the link, you can buy online you can also change the date to reflect your travel date. Inexpensive fares are generally posted around 90 days prior to departure date.
You might not be able to buy 'one way' tickets online for 'international travel' from Budapest by train.
I tried this earlier in the year and had big issues with the website. In the end I had a Hungarian friend phone them and they confirmed I could only buy the ticket at the station. But the good news is that buying a ticket at the station is incredibly easy. The international ticketing office is different from the local one. Go into the main entrance and it is 75 metres down the left hand side of the station, very easy.