I respectfully disagree with a portion of this response. If the bank has a valid and perfected first priority lien on the landlord's property, then this individual has no claim against the bank, presuming that the bank complies with the appropriate noticing requirements for a non-judicial foreclosure (I'm assuming that this is the method of foreclosure that the bank is pursuing) .
This outcome would be different if either the lease was recorded or a Memorandum of Lease was recorded prior in time to the deed of trust recorded by the bank.
I agree that the individual may have a claim as against the landlord's estate.
I stand by my response. If you have a contract to buy a property subject to a mortgage lien, the mortgage lien has to be paid off at closing. That is true in all transactions involving the purchase of a property (except where the mortgage will be assumed by the buyer with the permission of the lender).
The mortgage holder has no ability to prevent you from buying the property.
As a contract buyer, you have an equitable interest in the property even before the closing of title.
If you have your financing in place, then pay-off the mortgage and buy the property.
If the bank is standing in your way, take them to court.