If it's a commuter train where people spend 30 minutes max and the trains go every 15 minutes on the same route, then no - it shouldn't have a restaurant in it.
But when it's a 2-10 hour trip, of course there should be a place to sit down and buy something to eat or drink.