Argh. Where to start?
First off, it is highly unlikely that the soldiers would have arrested Mary for being Jesus’ mom. The ancient Greco-Roman world and the ancient Jewish world both had their problems, but that wasn’t one of them. Although women in general didn’t have certain Roman or Jewish rights, a mother who was a respectable matron or widow did have certain special rights under both Roman and Jewish law. Also, moms tended to run the household in both cultures.
Of course, it is true that in certain circumstances, Roman rulers could order that all of a person’s relatives suffer penalties, or even that all the people in a town or province suffer penalties. They weren’t against collective punishment, per se. But that stuff didn’t happen unless it was ordered, and nobody had ordered it. If it had been ordered, Pontius Pilate would have made a very big thing of making sure that everybody knew.
Second, having your relatives see you die, and you having to see them see you die, was widely regarded as part of a criminal’s punishment in all sorts of places in the world until recently. There are still ballads about it.
Third, women in the Roman world didn’t usually attend their menfolk’s executions, but fathers often made a point of attending and thus rejecting their son’s evil actions. Occasionally fathers would plead with their sons to do something to appease the Roman authorities before they were killed. (This could be beneficial to the family, as executed people sometimes had their property confiscated away from their wives and kids.) It was also perfectly normal for a father to just attend and bear witness for the rest of the family. Either way, the soldiers would have no reason to interfere, unless Mary had been carrying a sword and attacking people. (Or riding an elephant at the head of an army and throwing fireballs, like messianic mothers in some Jewish legends.)
This isn’t to say anything against Mary’s courage. It was very courageous to face her Son’s pain and suffering and to stay with Him at the foot of the Cross, as well as having to hear ignorant remarks and insults against Him. She may have received some nasty remarks herself. But at that time, it was not the courage of facing persecution.