If an inbound German train is late to Basel by more than 20 minutes, the Swiss run their own substitute train from Basel (they keep rolling stock on standby). The replacement train runs to the original timetable so that local passengers are unaffected. The late train is then pulled out of service at Basel (there are frequent onward connections).
They do something similar at Schaffhausen.
Trains that are late into St. Margrethen are made to queue behind local traffic.