Unpaid water bills are an issue that is coming up more frequently because of the number of foreclosure homes that are being sold. Water bills are different from other utility bills. Water is typically provided by the city rather than a utility company. The city always collects water bills, they never get "stuck". This is because the city has a tool that other utilities don't have. They can assess outstanding water bills against the property just like taxes. If you refuse to pay a water bill it will eventually be assessed to the taxes for the property. If you don't pay your real estate taxes you lose your house. The city doesn't care who used the water, they just want payment.
When you purchase a foreclosure, the bank should have paid the water bill, but it doesn't always happen that way. If the previous owner had their water shut off for non-payment and no one ever turned the water back on it's likely there is a water bill out there somewhere.
The title company might find it when they do a title search if its been attached to the taxes, but it could easily be missed. The only way to know for sure is to talk to the water department and verify all water bills have been paid for the property before closing.