If the lender foreclose upon the single family residence or 1-4 units, there is no deficiency judgment. Also, if lender forecloses upon the property in a non-judicial setting, there is no deficiency judgment by the lender who choose to foreclose upon the property in a non-judicial manner. However, junior lien holder may survive depending upon the timing and purpose of the loan. Especially, when the loan was taken after the purchasing of the property as Home Equity line of credit or for home improvement loan.
Its better to be proactive and take responsibility of the debts and consider all your options before letting your property be foreclosed upon by the 1st lender.
Ofcourse, if the property is investment property other than single residence and or more than 4 units , and if the lender choose to proceed with judicial foreclosure, it could recover deficiency judgment against debtor from the court.