This is impossible, unless you want to give up the idea of a SECRET ballot.
The first thing cheaters want done is to get all the ballots - mail-in, in-person, absentee, provisional, whatever - into one pile, anonymous and untraceable. You can't tell if a ballot came in three days late, or from a precinct with 150% overvote, etc.
Is there a legal term for a case that is, by definition, impossible to prosecute?
That is true but if the number of illegal voters exceeds the margin of victory the election can be invalidated.
You do not have to know who the illegal voters voted for.