The Realtor ( and his Broker) are at fault here for not protecting the interests of the buyers, and letting them go to escrow on an occupied home...and to know about the risks
It is their responsibility to know the law and write legally enforcable contracts.....and a lesson to buyers to have your own attorney review contracts and attend the closing
Buyers Should be able to sue RE company for damages
Suggested additions:
Search the Country Records for everything that you can find re the property - particularly survey lines and long-lasting markers (as in, no wood). If you suspect that you have any need for a surveyor to look over something, hire a surveyor to accompany you to the site, and consult with your surveyor.
Inspect the property - the inspector you hire, go with that inspector and inspect *everything* and TEST *everything.*
All that, before making any bid/offer.