Escrow closed but the property is still occupied by the tenants

I’m a realtor representing a buyer to purchase a short sale property in SF, CA. The buyer’s purchasing the property for owner occupied. However, few days before closing (Aug 26), the seller’s asking for renting back the property for 19 days & would pay the rent for $1,500 to the buyer. 19 days past & the buyer received $1,500, but the tenants refused to leave the property. According to the listing agent, the previous owner stopped all the utility services to force them to leave, so the tenants went to the Rent Board to sue the previous owner…Finally, we come up the agreement–the tenants agreed to leave the property by Oct 10, and the previous owner will be responsible for all utilities and the rent for the time the tenants stayed at the property. Questions: There are 3 tenants living in the property for only few months and without signing any lease agreement. Do they have the right to stay at the property? Is the seller liable to the buyer for that? Is there anything we have done wrong as a listing/ selling agent? If the tenants don’t leave the property by Oct 10, what can I do to protect the buyer?

You should immediately start unlawful detainer (eviction) proceedings. If the renters have agreed to move, then I’d have them sign a stipulated judgement to the unlawful detainer (basically they agree to be evicted if you do your part in the agreement). If they fail to live up to their side then all you have to do is file the judgement and schedule the sheriff.
Seems to me that the seller would be liable to the buyer for any loss the buyer incurs (having to rent somewhere else, etc.).
This is why I never agree to anything but possession at close.
Finally - note that I’m not an attorney, and you need one. CAR’s Legal Hotline is awesome, and should be your go to place for this type of issue. In this case, however, I think you’ll just need to hire someone to get the unlawful detainer filed and the stipulated judgement done. With any luck they’ll just move as agreed, but for a few hundred bucks in attorney fees you can make sure this comes to an end.