There is a custom in Japan where most people do not eat food outside other than when in restaurants. However, when using the bullet train or the green car, you are permitted to eat food. Normal trains and people commuting using said trains do not permit the consumption of food whilst riding the train.