"the two men": This tells me only of men (as being required to stand). Whence do I derive (the same for) a man (contending with) a woman; a woman with a man; two women with each other? From "who have the contention" — in any event. If so, why is it written "men"?

Because it is written (Ibid. 15) "By word of two witnesses, etc.", I might think that a woman, too, may testify; it is, therefore, written here, "two," and there "two." Just as "two" here are "men," and not women, so, "two" there.

"who have the contention": Let the owner of the (disputed) ox come and stand by his ox.