All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
It is permissible for a Muslim to ransom the Messenger of Allaah with his parents after his [Prophet’s] death. The evidence for this is what Al-Bukhari reported about the story of the death of the Prophet that ‘Aa’ishah, said, “Then Abu Bakr came and uncovered the face of the Prophet kissed him and said, 'May my father and my mother be taken as ransom for you. You are good in life and in death. By Allaah, in Whose Hands my life is, Allaah will never make you taste death twice.'" [Al-Bukhari]
This expression does not mean that he will ransom him from death, as he has already died, but it is intended to express perfect love and respect for him, as well as other similar meanings.
Allaah knows best.