The train was travelling from Bern to Zurich during the middle of the day when the driver passed out, the SDA news agency said.
Thanks to an automated security system the train came to a halt without incident at the station in Olten in the canton of Solothurn.
Another driver took over and the train was delayed in its destination by 15 minutes, SDA reported.
The driver who lost consciousness was taken to a hospital for a checkup.
The emergency system was triggered when a pedal that the driver is supposed to press continuously was released, an SBB spokesman said.
The system is designed to ensure that a train cannot operate without a driver actively in control.
The incident is the second of its kind on Swiss public transport in the past month.
The driver of a trolley bus in Basel passed out on April 22nd.
The vehicle ended up zigzagging though an intersection striking a parked car before a passenger was able to activate the brake.
The bus came to a halt but two passengers were taken to hospital for treatment of injuries.