I sort of think you are stretching a bit when you toss in Prague. Have you thought about the route? Prague is adding at least 10 hours of travel time.....
But okay. My first choice for New Year would be Salzburg. Hands down they do New Year well. Worst choice for New Year would be Budapest. Just not a big deal in Budapest. First choice for Christmas Markets would be Budapest. No, actually, it would be a tie with Vienna. But I believe the Budapest Markets stay open longer (till new year), but not in their full glory after Christmas eve. Prague might be good, but I dont think the best at either of those moments (New Year or Christmas).
For the beauty and the ambiance I also choose Budapest...
I would do
Day 1 Arrive Vienna
2 Vienna
3 Vienna / Melk
4 Vienna
5 Vienna
6 Train to Gyor / Pannonhalma Archabbey
7 Train to Budapest
8 Budapest
9 Budapest
10 Budapest
11 Budapest
12 Train to Salzburg
13 Salzburg
14 Salzburg
15 Depart