I've done a few studies on this.
Dresses or pants?
People who advocate women only wearing skirts / dresses; usually have no answer for the fact that if you define "woman's garment" as being "open at the bottom" than you could technically argue that Christ wore a dress. LOL
That being said though, and the fact that most garments be they for males or females were technically "dresses". Not withstanding though, pants did exist in the ancient world. Of course people in arctic climates (out of necessity) have worn pants for millennia.
In Leviticus, the priests were told to wear linen breeches / type undergarments that covered from waist to knee, so that when they ascended the stairs to perform the sacrifices, those of the congregation (standing on the ground) would not see... more of the priesthood than they wanted to. LOL
God also commanded this so He would not see more of them than He wanted to either.
So yes, there were pants in the ancient world. Roman soldiers wore leather pants at times; (went to the knee). That though was usually when they were out on campaign in wilderness areas.
Mens' garments?
If you look at the Hebrew in those verses in Deuteronomy 22 though; they are actually talking about warfare. The word sometimes translated "garment" is a reference to battle armor. Yet the verse is not saying woman shouldn't got to war either. Women have also been combatants in wars for millennia. The Roman army had "female auxiliary forces" who protected the family encampments when the male soldiers were out fighting.
So what do these verses mean?
A woman is not to "put on above and beyond (battlements) pertaining to a man" and a man "is not to wear women's clothing".
Now when we take the two halves of this verse together in context of warfare; women are not to be stuck out on the front lines as human shields is what this actually means (as trying to deter the enemy). And men are not to dress as women; by implication being to avoid combat.
Now this of course makes more ethical sense than quibbling over what constitutes male verses female garments.