The first, second, third mortgage or deed (mattering if you are in a mortgage state or a deed of trust state) is the order in which your position is to the title of the property. Whatever position you are in – to get to title you must make whole anyone who is in front of you and anyone behind you gets wiped out. Therefore for the mother to foreclose on the property in the second position, she needs to pay off the first lien holder. If there was anyone in the third position (let’s say a contractor did work on the house and did not get paid so s/he put a mechanics lien against the property) this person in the third position would get wiped out and now only have an unsecured debt against the person.
If you lease was signed PRIOR to the mortgage holder and of record then your lease would actually be in front of their lien and in a foreclosure they would have to recognize your lease. Of course if it is a month to month with either party allowed to cancel with 30 days notice- they step into the same rights as the original lessor. If your lease was signed after the mortgage – they do not have to honor your lease but nothing would prevent you and the party that forecloses to make new arrangements.
My take – it is a mess – why waste time dealing with it – take control and choose to rent a place without all the drama.