@jean I think that might be the most visually appealing one, if you don’t count the much shorter again Flåmsbanen/Flåmsbana ~1h. There are five main lines in Norway, Sørlandsbanen (Oslo-Stavanger), Bergensbanen (Oslo-Bergen), Dovrebanen (Oslo-Trondheim), Rørosbanen (also Oslo-Trondheim), and Nordlandsbanen (Trondheim-Bodø).
You could take a train from Bodø, change trains in Trondheim, then change again in Oslo, and go to Bergen, (or Stavanger), and that would take about 24h i believe, and with a short stop for re-boarding at the line ends. (Or the opposite direction).
Here is an extensive (but hard to read) list of all railway lines in Norway. When I grew up in Trøndelag, our house were a stone throw away from the Hell-Storlien(Sweden) line.