I have never had that exact situation but I have done dozens of evictions and more than a handful of forecloses, so I think I have a reasonably good handle on how these things work.
Unless you are in a strongly pro landlord state (if such a magical place still exists) the new homeowner will have to go through the unlawful retainer process.
In other words; the sheriff will not kick them out without a writ of execution. Why? Because how does he know that the squatters are squatters and not lease holders? That is to say, there could be an explanation of why they within their rights to stay put. And it is not the sheriff’s job to review the evidence, weigh both sides and sort the situation out.
That is a job for a judge.