LeandroGiuliani Can I buy train tickets the day before departure using vending machines?
You can buy tickets up to the moment of departure. In fact, most train tickets are bought close to the time of travel. The rule is just that you must be in possession of a ticket before you board.
Trains are mass transit, used by people to go about their daily business. Normal train tickets are valid for a route, so you can use them for a single trip between the origin and destination printed on them, on the day they are valid. So you are not even buying “train” tickets as such, as the ticket is not for a specific train.
The easiest way to do so is to use the SBB app. If you have an apple device and apple pay you can use that. If you have an android device I assume google pay would work as well. Otherwise use ticket vending machines, but best make sure you have a PIN on your credit card. Vending machines however also take cash.