I haven't read through any of these replies. But I will say that my wife and I did that exact same trip in May a few years ago and absolutely loved it. Four days in each city is exactly the perfect amount of time. Don't second-guess yourself on that. I will just mention a few things that were highlights for us.
Vienna: If you like wine, look at having dinner in the wine villages on the outskirts of the city. We liked that so much we did it twice. You can take a bus there. Also, if you like wine, we did a great bike trip through the Wachau Valley with a tour group. Very beautiful and memorable. And the Kunthistorichies (probably spelled that wrong) Museum is a must.
Budapest: Try to see a show at the Opera House. We took a tour of the opera house in Vienna. But for about the same price, we saw a ballet at the Budapest Opera House. It was fantastic. Buy your tickets online in advance. Also, be aware that many of the cheap seats in the upper areas have obstructed views. Fork out a little more for a decent seat. Also in Budapest, there is a museum called the House of Terror or something like that that is housed in the building where they used to jail people in the Cold War. This was unexpectedly poignant and fascinating.
Prague: The whole city is beautiful. Look for hidden gardens.
All three cities are great. Vienna has the most big "attractions," Prague is the most stunningly beautiful, and yet Budapest was probably my favorite of the three cities.