My experience is that when buying tickets anywhere but at the station they usually want to see your ID / passport when buying tickets, but they're accepting a copy or even just the number when you don't have it with you. After all, they're making their 5 RMB no matter if you are allowed to board or not.
I think I've not had an ID check when boarding, _but_ they run ID/Passport check in the train itself. That was on longer nonstop rides, though, where the staff had time to check each and every passengers ID without being in a hurry. Having that many train staff certainly helps doing such personal check.