@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.