In a statement SBB said the system allows automatic accelerating and braking and allows a train to run at an optimum speed for saving energy.
The tests were carried out for three nights on the Bern-Olten line on double-decker trains carrying no passengers, an SBB spokesman told news agency ATS.
The system is similar to the autopilot function in a car or plane, and does not mean that trains would operate without a driver, stressed the company.
A driver would always be present and could intervene if necessary.
“Job descriptions change but the knowledge of staff remains essential to enable these new technologies to be used in the best way,” said SBB.
The autopilot tests are part of a wider SmartRail 4.0 digitization programme which aims to “increase the capacity and safety of the Swiss rail network while making savings,” it added.