All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger. {C}
The debtor is acquitted from his debt once he dies in the case which you asked about. Therefore, he will not be accountable for failing to pay his debt.
Some scholars are of the view that the one who is in debt because of a lawful reason and who remained unable to pay the debt until he died is not held accountable for it in the Hereafter, even if the creditor does not write it off.
Al-Aadaab Ash-Shar‘iyyah reads:
“If the debtor takes money for a permissible reason and he intends to repay it but was unable to do so until he died, then according to Imaam Ahmad, he will be held accountable for it in the Hereafter. It is not certain (it should be looked at) whether this is an explicit statement of Imaam Ahmad or if it is only something understood from his statements. I have not come across such a statement from the scholars of the Hanbali School, but the statements of Al-Qaadhi (Abu Ya’la), Al-Aajurri, Ibn ‘Aqeel, Abu Ya’la As-Sagheer (son of Al-Qaadhi Abu Ya'la) and the author of Al-Muharrar [who was the grandfather of Shaykh Ibn Taymiyyah] is that, ‘He is not held accountable for it. His spending of the money extravagantly or thriftily is not a reason to ask for it – contrary to the view of Al-Aajurri – even though he is required to spend it in what is not forbidden.’”
Allah knows best.