Hello Ley
Either is possible. When holding a 2nd class Swiss Travel Pass, you have to purchase a so-called class upgrade ticket at half fare for the route you are going to take. You can purchase it through the SBB webshop, with the SBB Mobile App, or at the travel centre in the train station.
Kind regards,
Roland