First place, I'd go Prague to Salzburg to Vienna to Budapest (or Salzburg-Prague-Vienna-Budapest) to avoid backtracking.
With advance purchase, you can book Prague to Salzburg by express bus to Munich (Hackerbrücke ZOB), S-Bahn to Munich Hbf, RailJet to Salzburg, for as little as 49€/adult. Total time, about 6¾ hr.
There are also three regional rail connections per day direct from Prague to Munich. You can purchase a Czech Rail ticket in Prague to Furth im Wald (Germany) for about 10€, then use a Bayern-Ticket pre-purchased from the Bahn website for 27€ to go from Furth to Landshut, then by regional train direct from Landshut to Salzburg, bypassing Munich. Total cost for 2 people, less than 50€. Total time, 7½ hr.
You can advance purchase express train tickets from Salzburg to Vienna from Austrian Rail for as low as 19€/adult. Standard fare on an express train is about 50€/adult. Two adults can go anywhere (Salzburg to Vienna) on slower regional trains with an Einfach Raus ticket for 35€ for both.