Its a Christmas tour!! That changes everything! No, not really. Was just curious.
Here is what I would do. Salzburg just didnt capture me the way it does some people. But it was well worth my time to visit. Prague has some very interesting aspects, but the scale of the city is such that unless you have some unique interest it is difficult beyond 3 days unless you make it a week and do a few days trips, and there are good ones but that more of a warm weather thing I think. Budapest I am biased as all get out. I moved here because of that bias. But most that come will say that despite my bias 4 days is about right. To be honest my gut tells me 5 days but ......
And you can do Salzburg to Budapest then Vienna and Prague all by train. I just hate passing through Vienna on the way to Budapest and not getting off. The flight to Prague from Budapest saves a few hours of travel time and to be honest I prefer a flight over being stuck on a train for hour after hour after hour. But even if you take the train from Budapest to Prague, it does not go through Vienna so its not like "returning" or back tracking. You cant do wrong here. Just the options,
When you get ready, post again in each of the countries for hotels and Christmas Markets and Day trips.
Day 1 Arrival Munich
Day 2 Munich sight seeing
Day 3 Munich sight seeing
Day 4 Morning Train to Salzburg
Day 5 Salszburg sight seeing
Day 6 Morning train to Vienna
Day 7 Vienna sight seeing
Day 8 Vienna sight seeing
Day 9 Vienna sight seeing
Day 10 Morning train to Budapest
Day 11 Budapest sight seeing
Day 12 Budapest sight seeing
Day 13 Budapest sight seeing
Day 14 Budapest sight seeing
Day 15 Morning Flight to Prague (or you can do the long train ride)
Day 16 Prague Sight seeing
Day 17 Prague sight seeing
Day 18 Prague sight seeing
Day 19 Train to Munich
Day 20 Flight home