No, Swiss trains do not offer free Wi-Fi, yet in major stations it is available.
There is one train type (Giruno trains) offering Wi-Fi on board, yet it is mostly operated on EC trains to Italy or on IC2 lines (Basel/Zurich-Lugano).
There is SBB FreeSurf service on trains; however, it requires a SIM card from a Swiss cell phone provider: Free internet with SBB FreeSurf | SBB
If you stay longer in Switzerland, I suggest that you should rent a Pocket Wifi Switzerland - Truly Unlimited High Speed Data (travelerswifi.com). It works all over the country, and I heard from other tourists that this service works very well at inexpensive costs.