Hello OlgaS
Yes, it is correct that refugees from Ukraine can use public transport free of charge for entry to their destination in Switzerland or transit.
The decision was taken in line with the decisions of the Federal Council of 28 February 2022 and in consultation with the State Secretariat for Migration (SEM) and European partner railroads (including Deutsche Bahn and Austrian Federal Railways). They only need to show their passport to the controller on the trains.
I wish you an excellent weekend.
Greetings, RahelW