The great days of train travel are gone, I think. In the 1970s train food was sometimes fantastic - except, of course, in England, where it was vile. In many capitals, the restaurant at the station was your best, most reliable place to eat; I remember a fantastic goulash at Zagreb station.
Few trains now have such good food. I rather like German sleeper trains for their quality breakfasts - a big warm roll with butter and honey, and strong bitter coffee. The plastic packaged croissant offered on the Paris-Rome train doesn't even come close.
And a few years ago I had a marvellous meal on a Hungarian/Austrian connection (we were travelling from Linz to Vienna but I think the service had actually started in Budapest). I forget what we ate, but there was a choice of a really good Spatlese wine and 5-puttonyos Tokaj, so we had both... no wonder I've forgotten the food!
Many German trains still offer a very reasonably priced and well cooked hot meal (or at least did two years ago when I last travelled there). One of my favourites is the garlic soup - the garlic is roasted and then cooked in milk, so it's like a very gentle white onion soup, not aggressively flavoured.
GNER now does good food on the London-Edinburgh run, but at a horrible price - £35 for one person and that wasn't pushing the boat out, just a normal meal with a small bottle of beer. Worth it if the boss is paying (he was). Anglian Railways did a lovely restaurant meal on many of their trains from London to Norwich, which you could wash down with local beer (Adnams, fortunately, not Greene King). But now One has taken over the route the service seems to be less regular than it was.
Few French trains have anything decent. Some just have vending machines. My technique in France is to find a good kebab or sandwich shop near the station (not in it) and grab something for the train. A few TGVs, apparently, are now offering a sort of packaged lunch you can order, but it's cold, and it's costly.
Italy is also rather poorly served, at least on the trains I've been on. (I discovered a little trick last time I was in Milan, though - look for the restaurant where the off duty train drivers are eating!) By the way, as a part-time French resident, I am mystified as to why the Italians call croissants 'brioche'. It's like calling bread cake!
When I compare the various European rail networks, it's Germany, Austria and Hungary that seem to win the competition. The UK is too pricey - the English seem to have an idea that good food is only for the wealthy - and France and Italy too poor.
And that's odd. I would have thought that the French would always beat the Germans when it came to food, but when it's on a train, the Germans win hands down!