Judge Lusindiso Pakade made the ruling on Wednesday after Mandla, Madiba's grandson and chief of his birthplace Mvezo, challenged an earlier court order compelling him to return the remains. He moved the remains to Mvezo from Qunu in 2011, without the knowledge or consent of his relatives.
The exhumation will take place at 3pm on Wednesday.
The original court order was made last week after 16 members of the Mandela family, including Mandela's oldest daughter Makaziwe Mandela, requested an urgent interdict against Mandla. Those proceedings were held in chambers.
Mandela's eldest daughter Makaziwe Mandela, her nephew Ndaba Mandela and niece Ndileka Mandela were in court to observe proceedings on Wednesday.
The graves are those of Mandela's eldest son and Mandla Mandela's father, Makgatho Mandela, who died in 2005; Mandela's first daughter Makaziwe Mandela, who died as an infant in 1948; and Mandela's second son Madiba Thembekile, who died in a car accident in 1969.
Order was granted 'erroneously'
Both Mandla Mandela and the other faction of the family were asked to file papers by 10am on Wednesday. But Mandla asked the court to overturn the initial order on the basis that he did not receive a summons to appear in court on Friday, and could therefore not adequately defend himself.
His lawyers argued that the order was granted "erroneously".
During proceedings, lawyers for Makaziwe accused Mandla of moving the bodies "illegally, in the dead of night".
It was reported on Tuesday that charges were laid against Mandla for the alleged illegal exhumation.
But advocate Phillip Zilwa, for Mandla Mandela, argued that the case brought by Makaziwe and 15 others was "frivolous", and that his client was unnecessarily dragged to court.
Advocate David Smith, for the Makaziwe faction of the Mandela family, argued that Mandla's application (to have Friday's order rescinded) did not deal with the substance of the application, which is how the graves were moved. Smith charged that Mandla's actions were "legally indefensible". – Additional reporting by Sapa