Undoubtedly you have dome something which is a major sin, namely giving false testimony or bearing false witness, especially since it has caused the loss of rights of some of the heirs of the deceased.
It was narrated that Abu Bakrah (may Allaah be pleased with him) said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Shall I not tell you of the greatest of major sins?” We said, “Yes indeed, O Messenger of Allaah.” He said, “Associating others with Allaah (shirk) and disobedience towards parents.” He was reclining, but then he sat up and said, “And false speech and false witness, and false speech and false witness,” and he kept on saying it until I thought he would never stop.
(Narrated by al-Bukhaari, 5631; Muslim, 87).
So we say to the brother who asked this question: if the father has given the two grandmothers their share of the inheritance, then you have to repent and seek forgiveness from Allaah for having given false witness, but you do not have to go to the court and announce that. You have to conceal that which Allaah has concealed.
But if the father took all the money himself and did not give the grandmothers their rightful share, then you must try to convince him to give them what is their due. If he does that, then all well and good, otherwise you have to go to the court, tell them that you lied, and suffer the consequences of your sin. In this way you will restore to people what is rightfully theirs.
There is no expiation for false witness apart from repentance and restoring people’s rights, if that false testimony resulted in depriving others of what was rightfully theirs.
The judge or qaadi has the right to impose whatever ta’zeer punishment he sees fit for the one who bore false witness.
And Allaah knows best.