You have gotten good advice already.
These two links may help you refine your choices:
On the latter map, if you zoom way in, you can see the rail lines. And, under Points of Interest/Traffic, you can turn on or off icons for the transport stations.
On the map, you can see that the most direct route from Bern to Montreux is via Fribourg and Lausanne. That is main line routing, with faster trains. It goes via Lausanne, where you may change trains, and , as you near Lausanne, just after the very short tunnel after Puidoux, a magnificant view appears on the left, of the lake and the alps. The last stretch into Lausanne goes through the vineyard towns. Sit on the left.
Via Luzern -
If you go as suggested, to Luzern, you have two route choices to get to Luzern. Faster, about 1 hour on the hour, or about 1 1/2 hours by other trains on the route via Zofingen and or Olten. The fastest one bypasses Olten.
Or, also as noted, you may take the slower and scenic route through the Emmental via Langnau im Emmental (traditional Swiss farm country, rolling hills, striking farmsteads.)
Going via Luzern adds a lot of time to the journey; in return you gain the scenic stretch from Luzern to Meiringen over the Brunig Pass as you head back to the west.
After you reach Luzern, the trains on the Golden Pass Route via Sarnen, Giswil, Brunig, Meiringen, Interlaken, Spiez, Zweisimmen and on to Montreux offers particularly scenic stretches as you approach the Brunig Pass and descend from it to Meiringen. That is meter gauge line, if you care.
The most scenic part of the Golden pass route is the stretch from approximately Montbovon downwards into Montreux with views of the vineyards and lakes. Arno's suggestion to go from Bern to Spiez- a pleasant ride that can take either of two parallel routes - will let you access the Golden Pass route by catching a train at Spiez to Zweisimmen. You save the time spent going to Luzern. Change trains at Zweisimmen and continue to ride the rest of the Golden Pass Route route to Montreux via Montbovon on one of the most scenic parts.
I've not suggested a route from Bern via Romont to Bulle to Gruyerz to Montbovon to Montreux. But, it is possible, uses lots of secondary lines and could include a visit to Gruyerz on the way to Montreux. It certainly is a possibility, and can pick up the very last stretch of the Golden Pass route from Montbovon to Montreux.
You can work out times with the timetable for all of these combinations.