This is a question which calls for legal advice, and therefore the proper response is that you should consult an attorney.
That said, the second mortgage does not just disappear if the first forecloses, as claimed below, or at least that's not the most likely answer. (If the first and second are the same entity there might be an argument that the second would be wiped out too.) Also, even if there's only one mortgage, it is possible that they might judicially foreclose and pursue a deficiency (although that is not at all common). Again though, that's the reason to get legal advice from an attorney.
As to 401k accounts, that an exemption issue. Again an attorney should be consulted, but there are both state and federal exemptions which could be applicable.