Rail to Bodo
From the sound of it you are a bit tight on time which makes it hard to suggest the better stops. That said, Trondheim is worth a short pause, if only to see the very well restored cathedral (with all the pious statues done by the same sculptor who did the erotic ones in Oslo).
The night train to Bodo from Trondheim is fun (particularly in summer so you get to see the scenery) but arrives in Bodo quite early and when I did it the connecting boat to Svolvaer was not until late afternoon (however, it was a Sunday & services may be better on a weekday).
But if the timing works for you, I'd try the 8:30am from Oslo & get off at Dombas for the Dovre line branch to Andalsnes. The scenery is almost as good as the Flam line. The downside is you return almost straight away & then have a bit of a wait (about 90 minutes) at Dombas for the next train to Trondheim which gets to Trondheim at about 9pm. Plenty of time to get the night train to Bodo if you're going straight on.
Enjoy the trip. Wish I was back in Norway myself
Dave