Rose, May is not total "shoulder season", more "early season". March and April are "shoulder" (after ski-ing ends), May has 3 public holidays in it (in 2018: Tue 1st May, Thu 10th May and Mon 21st May), with a lot of people going away for a long weekend.
Some of the cable cars close for maintenance, but they should be open for the 1st May holiday weekend. Towns never close, people live there. And Lausanne, Bern and Luzern are cities, with tourism as a minority industry.
The cable cars and mountain railways rarely close for bad weather (strong wind may close cable cars). The bad weather is usually clouds, which prevent you from seeing anything when you get to the top. That is unpredictable. You need to decide on the day whether you go up or not.
Was thinking of booking tickets and hence need this help.
I hope you are talking about air tickets. It is never necessary to book rail tickets fro Switzerland in advance.