Railway companies (around Europe) have cut food sales due to lack of profits from them and the difficulties to implement them in certain trains. Others have kept them and if run well they can bring in money.
So you need to have a train company which is willing to take measures to sell food or have an other company in to do the food service.
Then you need a train that is compatible or a food selling service which can handle the shape of the train. And as some food and drinks sellers have nothing but a backpack to sell from, most trains will allow some selling.
My guess is that the train companies that do not sell food and drink, or allow others to do so, on their trains have come to the conclusion that the most passengers do not stay on the trains long enough to spend enough money to make it worthwhile.
In the Netherlands, where I live, most train services have to do without food services, some have or used to have the backpack services. In the past double decker trains where fitted with lifts so carts could be brought up and down into the cabins. But the service was discontinued as the sales did not meet expectations. Later a few long distance services did get the new backpack approach but I have not used those trains enough to be sure whether they still work.