Buses can pick you up from city central to town while trains travel from station to station
Buses have more timings while trains have odd fixed timing at night
Buses take about 5 hours and a half while trains take about 8 hours
Buses are cheaper than trains
Trains are the best if you get car sick
Overnight trains give you a full day in Hanoi or in Sapa so you can have your arrival/departure flight in the daylight or full day sightseeing.
Trains are much safer than buses (trains are the best while buses’ accident can happen)
Trains even have comfortable sleepers which are better than local coaches.
There are just about 2-4 passengers in a train cabin than 20-40 people on a bus. You can book a private cabin for yourself only if you prefer privacy! Trains have VIP 2 berth cabin for couple or 4 berth cabin for your small family.