We are trying to decide what is the best option. They probably would be cheaper to buy there but how much? We would hate to waste valuable sightseeing time trying to purchase tics. OTOH perhaps we could buy tics in Budapest where we will start our trip for the other two cities. Any thoughts?
I would buy your tickets at the RR station before you board the train. You can do it in seconds; you wont waste time. In that way, if you change your plans you are not tied to a specific time and day.
If you can commit to specific dates and departure times well in advance, you can get SparSchiene fares of €19 for both Budapest-Vienna and Vienna-Prague. See this page on the Austrian Rail site. Book by phoning the call center. Dial 011 (US international access code) + 43 (country code for Austria) + (0)5-1717. However, be sure to omit the zero in parentheses. It is only used for calls originating in Austria.