When that happens often enough, the supermarket installs something that locks the wheels when the trolleys go out of range.
You can still get the trolley away by other means, sure, but I imagine it's a pain to have to do that when there are wheels right there.