Dining is almost always available in the dining car, which is either a separate carriage or part of Second Class. (Note: On some trains, dining car seats are actually sold, so you might have to take all your food with you! Also beware the rather expensive “tea seats” in the dining car, which are present in a few long-haul services!) Food prepared “live” is available only on non-high speed trains. On HSR trains, prepared and heated “packaged food” is available. It’s still an experience as this is how the local workers do food!
Western food is generally not available on trains (this obviously being the case as this is China!). However, the Chinese will still offer specially prepared Halal food if your religious confessions require this (because there is a Muslim minority in China).
Note: Business Class tickets include a free meal if you are travelling around meal times. (This is after 11:00 in the morning or 17:00 in the evening; however, there have been times where trains departing just after 12:30 from the origin station have been unable to offer the meal for free.) You are usually limited to just one free meal — and the free meal service might not be available on short-haul services (you might have to pay).
Prices are somewhat a bit higher than the average restaurant on the streets — this is so because you pay a premium for services on board. However, it is not exorbitant. The most expensive food (offered at around RMB 55) is made available for free for passengers travelling in Business Class.
Finally, outside of the food, all Chinese trains, high speed or not, all have free hot water. Depending on some trains, the water may just be moderately hot; others have extremely hot boiling water. On high speed trains, just put your cup or water bottle beneath the tap, and press and hold the button for hot water until you’re done. It’s best to fill your cup two-thirds full, for safety reasons, so that hot water doesn’t overflow.