If you'll be in Vienna, I would really recommend a quick trip to Bratislava, Slovakia. You can take the bus there for a few dollars, and the trip only takes about an hour or so. It's a great little city (despite the giant Kmart and Little Caesars in downtown, which are so out of place), my friends and I really enjoyed it. Great food, friendly people, good beer, good exchange rate.
As for Budapest, that's the easier of the two to get to, via train or bus from Vienna. Budapest is wonderful. Go to the Buda side for the underground tunnel tours and the castle. The Pest side is the busier touristy side. I found the hotels to be super expensive, so my friend and I did a private homestay for about $7 per person (back in '95). We got the keys to a townhouse with a sweet little old lady as our host. We found that through the tourist information booth at the train station.
You'd probably need to get a flight or an overnight train to Prague (Czech Airlines is fine).But Prague is gorgeous too. Go to the Charles Bridge at night to hear musicians and see the wonderful view. Be sure to see a puppet show while you're there, and don't forget the Mucha Museum and the Kafka House.
Your two choices are both excellent. I think it'll be just a question of what's more convenient for a weekend trip. I'd have a tough time choosing. Consult a travel guide for all the museums and recommended sites (too many for me to suggest here). You will have a great time either way.
Enjoy!