It doesn't seem like the best idea to me, as both rides (Vienna-Budapest and Bratislava-Budapest) last 3 hours each. So you'd be adding time to your travel by going back to Vienna. Plus, the cost of the ticket to Budapest will be lesser if bought in Bratislava. Vienna is one hour away but it's a whole different whole costwise !!!