Quitcat – You are right that foreclosure is a process and many things can be done prior to a sale. Now, since the 2nd TD holder currently owns the property and it presumably went to auction, in which case the 2nd TD holder purchased it, you still might be able to buy the property or make some other deal with the 2nd note holders, which could include making the 1st TD holder whole again. However, you are in a tougher position than prior to the sale.
I would consider trying to construct an offer (if the property is worth it) with the 2nd TD holder. If the property is worth less than 110% of the amount owed, I would let it go.