I recommend to take the bus if your next destination is Vientiane. It might takes 20 - 30 minutes more but you end up being faster because the bus actually stop direct in the heart of Vientiane city + we pick you up and bring you to your hotel, guesthouse or hostel included.
The train is cheaper and faster but you end up being solwer and more expensive. Why? Because the train station in Vientiane is located outside the city and you need to grap a Tuk Tuk or a taxi.