Mallards reproduce by group sex, with multiple males mating with a female against its will. This means that the common explanation of ornate birds evolving due to sexual selection isn’t applicable to them, so I’m curious why else they would evolve their green heads. Could it be a vestigial trait or are there any other explanations?
The simple answer, as suggested in the comments, is that mallards are generally monogamous, with extra-pair copulations occurring but not canceling out the pairing, and with the note that some extrapair copulations are initiated by the female, e.g. female mate choice:
Once females had paired, it was observed that there was a trend for females to have displayed only at higher ranking males than their eventual partner (Wilcoxon signed ranks test, T+ = 30, p =.07). Of 10 females, eight displayed at more than one male. Out of 97 pairing displays by these eight females, only two by the same female were directed at a lower ranking male. Both these occasions were when the female's partner had displayed with another female and were directed at the next highest ranking male.
"Ranking" was essentially how quickly a male got into a pair, and it was strongly associated to breeding plumage (Table 1 of the paper). The sample size is a bit low, admittedly, but I'm sure the references of this paper have more to say about pairing behavior.
However you feel about "ranking" males, which I personally have mixed feelings about, this seems like a pretty textbook case of sexual selection.