To me, it seems like the water table underneath a village would be clean, or at the very least, more diluted, if the village is situated farther from a city. The same could apply to a castle.
Was it the case that people living in these places would drink water straight from a well? Did they still brew beer whenever possible, perhaps out of custom?
Hi, I'll leave your specific scenario for others to tackle, but just fyi, we get posts that carry the assumption that "people drank alcohol because water was unsafe" all the time in this sub; here's a fairly recent thread with some good discussion: