If the buyer dies his estate will inherit the debt (if they want to receive the inheritance they will have to pay the debt). This is not an absolute safety, as maybe no one wants to accept the inheritance (debts are higher than assets) or there may be other situation (bankruptcy).
In your specific case in which the loan is to be used buying a defined item, the lender may place a lien on the item(s), in this case the tractor, making it a secured loan. If the borrower defaults, the lender may try to recover the item(s), and sell them to pay back the outstanding debt. The lender has priority against other debtors.
This is neither 100% safe: the item may be not enough to cover the debt, or it may not even be available (it was stolen or destroyed in a fire). And not all loans are secured.
Typically, when the bank detects some loan that has a high risk of not getting returned, it will make a provision for the value it estimates may be lacking. That provision is an asset that comes at the expense of less money being available to loan. This help ensure that the bank does not borrow over its own possibilities; it won't count that it will have the tractor money back to loan it again.
That money is accounted as a loss for the bank. This is in line with the general rule of accounting that losses must be reported when it becomes apparent that they will happen, not when they are finally realized.
When it is finally settled the amount that will not be recovered, then that amount is deducted from the provision; any remaining money from the provision goes back to the bank as profit.