You can have set meals delivered to your compartment or take advantage of food-and-drink carts.
Buses are also the slowest option for getting around.
Hard-sleeper cars -- the cheaper of the two options -- have six berths, meaning that you could be sandwiched between someone sleeping above and below you. The cheapest train ticket, a 'soft seat,' provides you with only a reclining chair in a crammed car.
Soft-sleeper cars are slightly more expensive but have only four people to each compartment. While not luxurious, soft-sleeper trains are the most comfortable option for getting some sleep on the long journey.
The most scenic way to see Vietnam while moving between points is by rail.
The air-conditioned trains show some wear and tear, but they are fairly comfortable.