What he was asking was specifically, that be inherited both in the sense a son would inherit from him, and in a sense a pure soul would inherit from him and take the mantle of leadership.
Isma`eel ibn `Umar bin Katheer (700-774) stated:
لا أنه خشي من وراثتهم له ماله، فإن النبي أعظم منزلة وأجل قدراً من أن يشفق على ماله إلى ما هذا حده، وأن يأنف من وراثة عصباته له، ويسأل أن يكون له ولد ليحوز ميراثه دونهم
He(Zakariyyah) did not fear their inheritance of his money, as the prophets are much greater in rank and virtue than to care for the leftovers of this world and to be this upset that their relatives are going to inherit some money not his son.(TAFSEER IBN KATHEER).
Ala’-ul-Deen `Ali bin Muhammad al-Khazin (725) stated:
الأولى أن يحمل على ميراث غير المال لأن الأنبياء لم يرثوا المال وإنما يورثون العلم، ويبعد عن زكريا وهو نبي من الأنبياء أن يشفق على ماله أن يرثه بنو عمه، وإنما خاف أن يضيع بنو عمه دين الله ويغيروا أحكامه، وذلك لما أن شاهد من بني إسرائيل تبديل الدين وقتل الأنبياء. فسأل ربه ولداً صالحاً يأمنه على أمته ويرث نبوته وعلمه لئلا يضيع وهذا قول ابن عباس
It is more worthy to interpret this as the inheritance of anything aside from money, because prophets never gave money as inheritance only knowledge, it is unlikely that a prophet of God such as Zakariya would feel sadness for the fate of his money if his cousins were to inherit it. He only feared that they might lose the religion of Allah and corrupt its laws, this is based on what he had seen from Bani Isra’eel who altered religions and killed prophets. He thus asked his Lord for a righteous son to entrust the nation to him and to inherit his prophet-hood and knowledge so they may not be lost, this is the saying of ibn `Abbas.( LUBAB-UL-TA’WEEL LIL-KHAZIN
Zakariya asked his Lord for a successor to succeed him in prophet-hood. Zakariya being the pious prophet that he is, wished for Allah to grant him a successor to support him and carry on his teachings, he also asked God to honor him and favor him by keeping the prophet-hood within his lineage.
If you still argue zakariya(as) feared even for his material possession from his relatives then read this Shia hadeeth:
حدثنا أحمد بن زياد بن جعفر الهمداني رضي الله عنه قال حدثنا علي بن إبراهيم بن هاشم عن الريان بن الصلت قال سمعت الرضا عليه السلام يقول ما بعث الله عز وجل نبيا الا بتحريم الخمر وان يقر له بان الله يفعل ما يشاء وأن يكون في تراثه الكندر
Ahmad ibn Ziyad ibn Ja’far al-Hamadani – may God be pleased with him – narrated that Ali ibn Ibrahim ibn Hashem quoted on the authority of his father, on the authority of al-Ryan ibn al-Salt that he had heard Al-Reza (s) say, “All the Prophets which the Honorable the Exalted God sent, forbade wine and confessed that God would do whatever He wills. The Prophets (s) would leave behind ‘al-Kondor (chewing gum) as inheritance (implying that they would leave nothing behind).”[Uyun Akhbar al-Reza, Chapter 30, page 630]