It depends on the type of train. From Budapest to Debrecen you are likely to take an InterCity or EuroCity train and even if the price of the ticket itself is the same, the price of the compulsory seat reservation is higher if you buy it the same day, as if you buy it at least a day in advance. The difference is only a small 120 HUF (about 0.40€), but it is there.
I’ve never used it, but MAV also sell electronic tickets. You can find further informations (in English) here. Depending on the ticket type, you can either print it at home or have to pick it up from one of the ticket machines at the Hungarian railway stations.
Train tickets are only more expensive if you don’t have one when the conductor comes and you need to buy one from her/him on board. There is no difference in the price between buying days ahead or minutes before the train leaves.
The one thing you should watch out for, is that sometimes large queues can form in front of the cashiers for various reasons. So if you have some time to kill, buy your ticket first and then enjoy the remaining time, rather than go for a stroll and return to see that you won’t make it to the end of the queue before the train leaves.
Credit:stackoverflow.com‘