Judge Angela Finnerty said the woman should not have brought the child to England until a family court in Japan had resolved a dispute she was having with the her estranged husband.
The judge's decision has been revealed in a written ruling.
It follows a hearing in the Family Division of the High Court in London.
No-one involved was identified.
The father had asked Judge Finnerty to order his son's return to Japan under the terms of international civil legislation relating to child abduction.
Judge Finnerty said the man and woman - who had worked at different universities in Japan - split in 2013 after marrying nine years ago.
They had reached an agreement about sharing care of their son after mediation in Japan.
The woman had then been offered a post at Cambridge and said she wanted to take the child with her. The man objected.
She had flown to the UK with the boy before a court in Tokyo had ruled on the dispute.
"I am satisfied that (the boy) has been retained in the United Kingdom unlawfully in breach of the father's custody rights," said Judge Finnerty.
A Cambridge University academic has been ordered to return her seven-year-old son to his father in Japan, a family court has ruled.