What you though was the fish in its stomach was actually the fish in its crop.
There is indeed a slim possibility the fish could get out, but probably not without the bird's cooperation.
Birds swallow food into the crop and digestion starts there; and the bird can regurgitate the contents of the crop if they want to. This is how they feed their young chicks. It is also part of the courtship ritual for the male bird to feed the female this way. Also, they will regurgitate any indigestible parts such as bones and skin, after the soft parts have been softened up enough to separate them.
I have seen a bird regurgitate the food in its crop just to have room for something it liked better.
Most likely though, the fish you saw was done for. I don't see any reason the heron would want to regurgitate it alive. It might well have a mate and chicks to feed, though. Both parents feed the chicks, and they take a few months to become proficient at fishing, so they will get at least supplemental feedings from their parents maybe even into the winter.
So if the fish is caught by a young inexperienced heron, it has a better chance to escape.