Graz Airport: Best airport for Leoben. Walk about 500 m to Flughafen Graz-Feldkirchen station, take the S-Bahn to Graz Hbf (roughly 10–15 minutes), then an ÖBB Railjet/IC/EC north to Leoben Hbf (about 45 minutes). Allow 1¼–1½ hours station-to-station and roughly €15–25 with a normal regional/ÖBB ticket. A taxi all the way is poor value for one person.
Vienna International Airport: Use the direct ÖBB Railjet where its timetable suits: Vienna Airport to Leoben is about 2 hr 10 min, with around a dozen trains daily according to current timetable listings. Otherwise change at Wien Hbf. Book an ÖBB Sparschiene fare early if your timing is fixed; expect broadly €25–50 rather than treating the airport as a cheap transfer point.
Leoben Hauptbahnhof: The useful arrival station. It is about 800 m northwest of Hauptplatz: a 10–15-minute walk with ordinary luggage, or a short local-bus/taxi hop if your hotel is uphill or across the Mur. Leoben has direct long-distance links on several Austrian and Central European routes, but check the exact ÖBB timetable rather than assuming every advertised city is a through train.