There are two main routes to travel from Norway to Sweden by train. The one in the North from Narvik via Abisko down to Stockholm. The second one in the South from Oslo in direction of Göteborg. In both countries you find very good night train connections to travel long-distance.
The railway network in the North of Norway is not connected between Bodö and Narvik. You have to take the bus for this part.