Taking it one day at a time:
It is an easy 1-hour train ride to Varenna from Milano Centrale: I suggest you go directly there for your first night instead of staying in Milan. The hotels should be less expensive, and it is much more scenic. This will move your whole schedule up a day and give you one more to spend in Zermatt or the Berner Oberland.
Varenna to the upper Engadine is 4 hours by Bernina Express or 3.5 by regional train. Thus, for the BE you would depart Varenna at 8:24 am to catch the BE at Tirano, arriving Pontresina at 12:25. Or you could depart Varenna for Tirano at 9:24 am and pick up the regional train which arrives in Pontresina at 12:55. They use the same tracks and pass the same scenery.
We chose the next village, Samedan, as our base in the Engadine. Hotel Garni Laagers consists of 4 rooms above a very nice bakery, and one of them is a one-bedroom apartment which will sleep 4 comfortably.
https://www.laagers.ch
There is an excellent “balcony” (traverse) MTB trail above Samedan; you could bike up or possibly access it by lift. We were hiking but saw numerous mountain bikers having a great time. Not a technical path, and wonderful views. I believe you could take the trail to St. Moritz and then ride back to Samedan on the road (or put the bikes on the train for the 3-5 minute ride).
There is also nice mountain biking at Zermatt. We saw numerous groups on the trail through Riffelalp even though it was snowing that day (in early July).
In the Berner Oberland I highly recommend you stay in Muerren. Your boys will love the Via Ferrata there (my husband did it when we were there last August). And since you will likely have Swiss Passes, you can ride up the Schilthorn for free.
The mountain biking around there is mostly either steeply up or steeply down. I think hiking is the better choice in the BO and there are many good ones. Personally I would not spend either the time or the money for the Jungfrau train.
We stayed in an apartment in Muerren which I can highly recommend. It is a 3-bedroom, 2 bath with nice kitchen, huge balcony, and wonderful views across to the Jungfrau massif. Two bedrooms have one queen bed each, and the third a set of bunks. I will go find the link for rental.
If you do not have your dates set yet, you could catch the Dorffest (village festival) in Muerren if you can be there over the first weekend in August. The parade was on Sunday this year and that will probably be the same next year. Rick shows part of it in one of his videos but seeing it in person is much better!