i agree with previous posters that both are beautiful, fascinating cities.
however, if i had to make a ranking of best cities, i'd have to put prague ahead of budapest simply because of the old town of prague. budapest feels more modern and it does not feel as if one is in "old" europe.