Regular mountain transport tickets
Tickets for cable cars, cogwheel trains, funiculars and other mountain transport can be purchased on the spot, and in many cases online as well. Reservations are mostly not necessary. See the individual mountain top excursions for online tickets, options to reserve a spot, and more details.
Discounted or free mountain transport
Note that mountain transport is relatively expensive. If you plan to make two or more trips into the mountains, it quickly becomes more economical to buy a rail pass. Most rail passes are actually "public transport passes", and also cover mountain transport: mostly they offer a discount, sometimes they offer free traveling. In case of free traveling you may still have to request for a free ticket at the desk, because access gates require a specific ticket type.