When the squatters leave the house, you break in and change the locks. Now you are the squatter.
Seriously there must be a time both are gone and with proper ownership papers the legal owner can access the property. Sheriff, or somebody should be able to assist somehow so that if squatters return they are turned away or carted off.