Upvote:2
I don't know about the Indian Railways specifically, but for prolong travel in close quarters, I would recommend non-perishable, non-messy foods that can be eaten cold. Many fruits (apples, pears, bananas) fit the bill, but anything that has to be cut up or is very juicy is out.
Typical Indian food isn't a good idea. Mutton vindaloo is pretty much my favorite food, but bring it on a crowded train, one errant elbow and you won't be eating it, you'll be wearing it. Anything with sauces or curries or creams is just begging to slide down your shirt. Big pieces of roasted mutton or chicken are much better, but bring something to wipe your hands with, before and after.
Bring a biryani and I bet you will eat a third of it, drop a third on the compartment floor, and find a third of it later in your pockets and luggage.