The two member states, who have steadfastly refused to take part in a scheme to move 160,000 people from Italy and Greece – the main ports of arrival – to elsewhere in the EU.
More than 1.6 million refugees and migrants crossed into the EU between 2014 and 2016, leading to rows about how to share the burden.
But so far only about 16,340 people have been relocated under the emergency scheme that is scheduled to end in September.
And furious European Commissioners are now threatening legal action against Warsaw and Budapest to in a last-ditch bid to rescue the failed policy.
A Commission spokesman said: “If member states do not increase their relocations soon, the Commission will not hesitate to make use of its powers for those which have not complied.”
The Commission had proposed to fine countries for failing to take in migrants but there has been little political backing for such a step.
A court case would not resolve the issue quickly but could add to mounting pressure for action from other EU states.
Cash-strapped Italy has been at the forefront of calls to cut EU subsidies to Poland and Hungary over their hardline stance on migration.
Germany, Sweden, Austria and France – the most frequent final destinations – have also been stepping up pressure.
Bulgaria, Croatia, Slovakia and the Czech Republic have taken in only a few asylum seekers and the European Commission also underlined their weak response to the plan.
The Commission statement reminded member states that the relocation plan was decided by EU leaders in September 2015 despite Hungary, the Czech Republic, Slovakia and Romania voting against it.
Although generally opposed to it, Poland eventually voted with majority.
Brussels said Austria had decided to join the relocation programme after being previously exempted as it had taken in 90,000 asylum seekers in 2015 thanks to its position on one of the key migratory routes into Europe.
Hungary has filed its own lawsuit against the relocation scheme and a hearing at the European Court of Justice is due on May 10.
Poland’s and Hungary’s disputes over migration with the bloc are just one area on which the two post-communist countries clash with Brussels and the wealthier European states.
Their eurosceptic governments have put their media and judiciary under tighter state control, raising concerns that they are blocking the democratic checks and balances central to EU policy.
The Commission has separately warned Hungary it risked being sued in court over a number of right-wing prime minister Viktor Orban’s policies.