When you buy a property that has an existing tenant the tenant's lease or month ot month arangement is carried forward untill the tenanats anniversary. Then you can raise the rent. but only by as much as the SF Rent Board allows that year.
It doesn't matter if the property is in default, bank owned, a short sale or any other transaction. The tenant has rights in San Francisco and both SF a California have laws restricting eviction. By the way, be aware that there are two areas of legal information that many prople confuse as one. There are rent control laws and there are eviction control laws. They are not the same.
This looks like a good price, with one unit vacant, but I would suspect that the other has very low rent and possibly a protected tenant. (San Francisco local eviction laws).