I think Prague has won it for me, on the basis that I can do day trips to Vienna and Dresden from there. Also Cesky Krumlov and Karlovy Vary look like interesting day trips.
I might save Budapest for when I go to Baku, as it's one of the main connecting points to Azerbaijan.