Vienna to Berchtesgaden will require one or more changes of conveyances. You could take a direct train to the Salzburg Hbf and a bus (RVO 840) from there to Berchtesgaden. An all-rail connection would require a local train from Freilassing, Germany, to Berchtesgaden, and I don't think any train direct from Vienna stops in Freilassing, so you would have to take a train from Salzburg Hbf to Freilassing. You can get Savings Fare tickets from the Bahn website for as low as 29€/pers.
For Berchtesgaden to Munich, you must again change in Freilassing. Hourly Regional Express (RE) trains and most express trains from Salzburg to Munich stop in Freilassing. A Bayern-Ticket (23€ 1st person, 4€/pers up to 5 total) will cover your travel all the way from Berchtesgaden to Munich if you use the Regional Express.
You could also do Freilassing to Munich on a faster EC for "as low as" 19€ for one, 29€ for two, but that ticket would be train specific and non-refundable.