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, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
If one of the children needs money to get married and the father bore the expenses of the marriage, then there is nothing wrong with that. The father is not obliged to give the rest of his children an equal sum of money. However, it is incumbent on him to help his other children with their marriage expenses as well in the future, if they need help. Ibn ʻUthaymeen wrote, “If any of the children needed money for his marriage and the father helped him with the marriage expenses, then he is not obliged to give an equal sum to his other children; however, he is obliged to help them with their marriage expenses in the future in the way that he helped this one.”
This is not the case in your situation because the father passed away and the ownership of his estate is transferred to the eligible heirs. Hence, the money that the father had given his older sons for the expenses of their marriages has no effect on their shares in the inheritance. Rather, the deceased's estate should be divided among the heirs regardless of whatever money he may have offered his elder sons prior to his death as long as they had accepted it and took it in their possession.
However, if the elder sons willingly and thoughtfully gave up a part of their shares of the inheritance to cover the expenses of their unmarried siblings' marriages in the future, then this act would be praiseworthy and they would be rewarded for it.
It should be noted that there is no specific wording for a valid gift-giving; a gift is declared valid and binding according to the acceptable standards in the common practice of a given community. Al-Insaaf (book of Hanbali jurisprudence) reads:
“A gift becomes effective by what people are accustomed to of common practice such as offer and acceptance or transfer of ownership accompanied with an acceptable indication of gift-giving...”
In your case, the money offered by the father to his elder sons is considered part of providing for them and not a gift, as underlined above.
Allaah knows best.