Tell her to use her voice, assertively, EVERY time:
'Please don't touch me. I don't like it.'
Tell her to be polite, firm, and absolutely consistent. Never be silent, never deviate from the script, never escalate.
Explain to her teacher that she is going to do this. Explain that this may mean interruptions to the class, but that in this case 'being good and quiet' is allowing someone to do something to her that she doesn't like and they shouldn't be doing, so you are sure that the teacher will understand.
The behaviour will stop - if the child is able to respond to your DD's constant instruction, he eventually will. If he doesn't, or can't, then the problem will become sufficiently far up the teacher's 'to do' list that it will get sorted.
DS was physically bullied in Reception by a child half his size. We knew he couldn't hit back without being accused of being the bully. So I taught him to use his voice - loud statement when inside, shout when outside 'Please stop doing that X, I don't like it / it hurts'.
It was stopped, very quickly. The teacher couldn't believe that the small boy could be hurting DS (a gentle giant) so consistently and so sneakily.