A train ride to Vienna is due to the good connection from a lot of major European cities simply possible. The trip from Munich by train takes around 5 hours, and the cheapest tickets are available from 40 Euro. The most important railway station in Vienna is the Hauptbahnhof. The Westbahnhof is only used by a few long-distance trains.
The railway station Hauptbahnhof is located beside the Wiedner Gürtel with the main entrance nearby the Südtiroler Platz. The metro station Südtiroler Platz – Hauptbahnhof of the line U1 is directly connected via a passage. The metro ride from the railway station to the Stephansplatz (CD3) in downtown takes only approx. 5 minutes, so you get easy and fast to the City Center of Vienna after a train ride.
The Westbahnhof is located at the Gürtel beside the Mariahilferstraße where you can also change to the metro lines U3 and U6. With the U3 you can reach the Stephansplatz (CD3) in the center in less than 10 minutes.
Links: Info to Stations Austrian Federal Railways Train Tickets in Comparison*