Youre missing the point somewhat.
You have two groups of people:
A) Ukrainian/EU nationals, 5 mins to process each person (for both the Ukrainian and Polish border combined) given routine visa-free access to the Schengen Zone
B) Nationals of 3rd countries, 15 mins to process each person (for both the Ukrainian and Polish border combined) given no routine visa-free access to the Schengen Zone
Which group do both sides of the border prioritise processing, both first the Ukrainian border agency and then secondly the Polish border agency, when your only goal is to maximise the throughput of people through the border? The answer to that question is obvious. There's tens of thousands of people at these borders waiting to cross. If you want to keep the maximum number of people moving, you focus on the low hanging fruit, group A, otherwise you are just going to have an ever-greater group of people having ever-greater wait times.
Now when you consider the demographics of the two groups and one will be slanted to men of student and working age, it's not just that group A is quicker to process and can have a greater flow rate, the demographics of group A will mean much of that group will be given ever greater priority, considering Ukrainian men of student and working age cannot cross and group A will therefore be mostly made up of women, children, elderly and people with disabilities.
I can't add any more on this issue, so I won't continue this conversation other than to say the following:
Racism is awful. Racism should be condemned. If border staff are discriminating based on skin colour or race,
rather than the passport/visa status, of people trying to cross the border, whether on foot, by car or by train, then that too should be condemned. I'm sure border staff have made mistakes and will have revised policies in what will have been an unprecedented humanitarian situation that you simply cannot prepare for. But if you are expecting Ukraine and Poland to inefficiently manage their borders and operate a strict system of first-come-first-serve for all people, regardless of their passport/visa status and their immediate need to cross the border, then you are being a bit naïve. No borders operate like that anywhere in the world. That's not racism.