If you book a room, your ticket includes two meals, but in my experience the food is not great, resembling food you'd find on a plane. When I took my 19-hour train ride, I was served pasta with chicken and veggies, a small salad, and a roll. The pasta was passable, but I thought the chicken was basically inedible. I didn't eat the salad because it was just a couple of pieces of lettuce. The best part of the meal was the roll with butter.
Additionally, the Amtrak trains have a dining car, which I found to be more formal and expensive. There's also usually a snack car where you can buy cheap bites.
Instead of spending a lot of money on subpar foods, I'd recommend packing a small bag of snacks.