You can wait till you are here. It is possible to get further discounts buying tickets in advance on some routes, but those tickets are not refundable nor are they flexible. So that could be an issue if your plans change. The only trains I would book in advance (if any) are from Switzerland to neighbouring countries. Within Switzerland you can treat the train network as a mass transit network. A nationwide subway (but above ground and with nice scenery…)