Train is the most comfortable option to travel between Bratislava and Vienna, but buses are cheaper (up to ~40%). There is no discount for advance purchase of train tickets, so you can simply buy it at train station before departure. When it comes to buses, you may also get promotional fare of 1€ / one-way (from RegioJet or Slovak Lines) when booking well in advance but amount of these tickets is very limited. Once they are sold out, prices of RegioJet and Slovak Lines are the same whenever you buy your ticket (but it's cheaper to buy it online rather than on board). FlixBus has dynamic pricing so booking in advance can save you money.
There is a direct city bus between Bratislava airport and central train station. Note that you must buy ticket before boarding the bus.