There is a rail line which unites Skagway Alaska with communities in BC. It’s the White Pass and Yukon Railway which was completed in 1900 during the height of the Klondike Gold Rush.
Today the railway does not carry freight but it is maintained as an attraction for tourists. The train ride is spectacular as it winds on narrow rails around mountains.
I will refer you to the fascinating Wikipedia page which explains the railway’s history.