In case you didn't know:
Half of the country speaks Russian as their first/ native language, not Ukrainian. That would be mostly East of the River Dnieper.
And the other half speaks Ukrainian as their native language.
Most Ukrainian-speaking Ukrainians can also speak Russian. A much lower percent who speak Russian as a first language can speak Ukrainian.
That would certainly complicate things... But if someone doesn't speak Ukrainian, you immediately interrogate in order to establish a Ukrainian versus a Russian infiltrate soldier. I'm sure they can ask a few questions that could establish someone's knowledge and, as you said accent.. that could determine the difference...