That sounds like such a fun trip! Well, I've never been on a train, so maybe 24 hours would be a lot - but I hope you get to see a lot of amazing scenery whipping by as you go :)
I have written some of my tricks for eating healthy while traveling (both on the trip, as well as while at your destination) here: veggiekate.com/2011/06/03/staying-healthy-
if you want more detailed info.
But for the trip itself...
-Fresh fruit that can last: apples, oranges, pears
-pre-cut fruit for within the first 4 hours (pineapple, berries, melon, etc)
-Another shorter-term snack can be hummus for veggies. celery, sweet peppers, baby carrots, cucumber, etc. Or if you like veggies plain, some of those are pretty good at lasting as well without being cool
-avocado (yep, just cut it open, and enjoy a quarter for healthy, hunger-curbing fats and fiber!!)
-small portions of nuts and seeds ( try pre-sorting into serving sizes so you don't go overboard)
-Dairy free, dark chocolate (doesn't melt as easily I find - I love the Endangered Species brand, especially the super dark one, and the mint!)
-tea bags (you can often find hot water if you ask)
-tub of mixed greens with half a lemon to squeeze on (again, can make it for a little while without refrigeration. I took this on a flight before, and it was still good when I ate it, about 6 hours in as long as there's no meat, eggs, or cheese, but just veggies)
And a huge refillable bottle of water!! :)