According to Rome2Rio (all numbers for the round trip):
- Driving from Vienna to Munich takes 4h 11min, costs 45-65 Euro, and produces 136kg of CO2.
- Flying from Vienna to Munich takes 4h 1 min, costs 69-287 Euro, and produces 216kg of CO2.
Compensating this amount of CO2 on atmosfair costs 10 Euro.
- Taking the train from Vienna to Munich takes 3h 55min, costs 50-85Euro, and produces almost no CO2 (in particular in Austria, where about 75% of the electricity come from water power).
And: you get to see a lot of snow if you take the train (might be almost the last snow in Europe if we continue heating up the planet…)