This sort of only works with non-ticket barriered although if it is station Café staff they could have a card to let them through the gate line.
All of the London Terminii would need to be included as well as all well served stations so it might be odd if they have a queue (although you could give an option so they can stop accepting orders)
I was thinking only of cafes within the station itself so no need to worry about gates. Don't think there's any need to involve London stations, although East Croydon (if memory serves) does have a cafe and could service Thameslink trains, some travel from Cambridge to the south coast with no catering whatsoever.
But the extension would be to allow deliveries from outside a selection of gated stations where no station cafe exists (or is closed) in which case a card/pass would solve the problem. How they would be distributed I've no idea, but I suppose cafes with delivery close to those stations could bid for the franchise/rights and "buy" the pass off the station operators.
I think it would work but requires a trial, one using station cafes and one using outside agencies. Also whether it would be safe to deliver hot drinks, or whether alcohol could be purchased. Adds that it would be impractical on packed trains where the door is difficult to access, let alone a seat!
But I'll return to my original plea - vending machines on "long distance" trains that have no catering, would solve the situation perfectly and no need for deliveries!