By having dozens of people watching everything except the actual marking of the ballot. Scrutineers are highly motivated: they want to catch the other candidate cheating.
I've been a scrutineer in a polling room. I could watch and challenge anything except the marking of a ballot. And I did. So did other scrutineers. The odds of the mobster keeping a rotating scheme without detection approach zero with great rapidity, especially since staying in the ballot after casting your vote is not permitted.