Personally, I think anyone caught illegally in Poland should be detained, but I'm rather hardline on this.
I am not from Poland so I can't say what Poland should do and since you are not Polish delph neither should you.
Without saying, ANY county that catches someone that has illegally entered their country is automatically detained.
I am afraid there will be bloodshed in Hungry about the next time the invaders start yelling "f*ck you" and pushing past the police.
The army is now involved and are not as tolerant as the police.