Yeah, at least in germany these are all just magnets. And outside of the store there is a long metal line, and when you roll over it, the wheel with the magnet completely locks.
This happened to me as a kid, and it was sheer impossible moving the cart back to the store.
You ever seen those invisible dog fences? Once it crosses an electrical barrier it triggers an alarm of sorts and in this case I assume it engages some sort of brake mechanism.