Cargo_pants already wrote why they can't stay in Belarus:
the Belarusian military is standing behind the refugees and will not let them back in mainland Belarus
They even try to push them forcibly through the border into the EU (including kids).
Yet another reason that crummy dictator Lukashenka must go!
Yup, but that human scum won't go... And so the problem won't go away. I think that apart from securing the border Polish government should make sure to somehow inform potential migrants/refugees from Iraq and Afghanistan what's the situation on the EU-Belarusian border so they wouldn't buy into what the human traffickers are promissing to them (and so they wouldn't be taking this route).
Also, in general - the EU should be helping Poland and Lithuania in this situation, imho, since this border is EU border and those migrants/refugees are likely to go further West.