It's only illeagal on TFL transport. Everywhere else, you can drink. Most trains even sell alcohol. Can't believe people don't know this. Don't you remember the massive drinking party in underground stations when the ban came in 2015/16?
I wasn't working in London prior to 2018 so don't have much experience of using the tube or overground except terminus stations in/out of the capital. It's been a long time since i've seen any buffet services on southern trains.