The treasurer, Josh Frydenberg, is not a Hungarian citizen and is eligible to remain in parliament, the federal court has ruled, in a judgment averting a possible byelection and disruption of planning for the second round of stimulus to combat the economic effects of Covid-19.

On Tuesday, the chief justice, James Allsop, and justices Susan Kenny and Alan Robertson unanimously decided in the deputy Liberal leader’s favour, finding that his grandparents and mother had left Hungary as stateless people and he therefore did not inherit foreign citizenship, a disqualification under section 44(i) of the constitution.

The petitioner in the case, a Kooyong resident, Michael Staindl, was ordered to pay the costs of the case.

The judgment lifts a constitutional cloud that had hovered over Frydenberg since his mother’s birth in Hungary was raised in 2017 at the height of the dual citizenship crisis of the 45th parliament, which triggered the resignation or disqualification of 14 MPs or senators.

Frydenberg will return next week for an abbreviated session of parliament to pass both the first $17.6bn stimulus package announced on Thursday and an as-yet-to-be detailed second tranche for sectors affected by Covid-19 and travel bans, including airlines, tourism, events, hospitality, sports and the arts.

The minister’s lawyers had told the court in February the challenge should be thrown out because the MP’s mother, Erica Strausz, had been rendered stateless after fleeing with her family in 1949.

In their judgment, the federal court justices described their task as having to analyse the legal status of Jewish Hungarians against a “background of catastrophe and anti-Jewish violence and terror”.

They accepted expert evidence the Strausz family left Hungary on a single use passport and an exit permit which did not permit re-entry into Hungary.

They said Staindl had “not only … failed to prove that any obligation of allegiance was at any time owed by Mr Frydenberg to Hungary, but also that the evidence is sufficient to conclude that upon leaving Hungary in 1949 the Strausz family lost or renounced any citizenship of Hungary and were stateless”.

“There is no evidence whatsoever that somehow the political changes nearly two generations later, in 1989, had any effect upon that legal reality as it existed in and after 1949,” they said.

Staindl had argued that Frydenberg retained a “shell” citizenship passed to him at birth “capable of revivification into full Hungarian citizenship by the political transformation of Hungary with the end of Communist rule”.

“If we may say so, the argument as to the revivification of a ‘shell’ of citizenship is an imaginative one, displaying a creative fineness of distinction, which may be, or may have been, seen as appropriate in some legal contexts,” the justices said. “Such an approach is inappropriate here.

“We are dealing with proof of a status of citizenship of those leaving totalitarian Hungary to whom those in power stated, with the authority of the ruling Communist Party: leave, as class enemies of the people, with no right of return.”

The justices concluded that not only had Staindl failed to prove Frydenberg was a Hungarian citizen in 2019 when he nominated for the 46th parliament, but Frydenberg had “proved that he was not, and never has been, a citizen of Hungary”.

“That conclusion is confirmed by the contemporaneous view of the current government of Hungary,” they said, referring to a letter from the Hungarian prime minister’s office on 19 November confirming Frydenberg’s Hungarian citizenship had not been established.

In December Scott Morrison said that the case against Frydenberg was “the most despicable case that I’ve seen undertaken against a member”.

In the 45th parliament the joint standing committee on electoral matters recommended the bar on foreign citizens in parliament be repealed or reformed, a call rejected by the Turnbull government in favour of stricter declarations on eligibility.