There is no suggestion in the article that she is being detained for her opposition to the Ukraine war.
She probably doesn’t have a great case. The culpable party here is 1000% her adviser who asked her to bring the samples back given “the complications [her adviser] Peshkin has experienced when French colleagues try to mail him research samples.” (Ok so you aren’t supposed to bring such material here…)
It’s unconscionable and incredibly stupid to put a foreign student at risk by asking for such a “favor”, which she surely didn’t feel in a position to refuse. He shouldn’t even have asked an American (who can’t be deported) to do such a thing!