You should eat on trains only when taking a long-distance train, such as the Shinkansen. These types of trains have a tray and cup holder at every seat, and snacks are sold from a vendor trolley. When taking this type of train, it is also acceptable to bring your own food.