You missed the whole point.
Trump already went to trial in a previous defamation case and lost. The jury determined that (as the judge told them in this trial) that the defendant “put his fingers in her vagina”.
This apparently created something (IANAL) called estoppel. Basically, this fact was decided. The court system, especially civil lawsuits, is not one where you can fight (lose) the same fight over and over until you find a jury that agrees with you. Once something has been decided, only the appeal court can overturn it - and only if they can show that either (a) serious error of law was made, or (b) the evidence was such that no reasonable jury would have concluded the result. (I’m sure a real lawyer can chime in to correct this.)
So what the judge was telling Trump and his team was that the previous trial had established as a legal factoid that Trump had committed sexual assault. Therefore, Trump could get on the stand, but he could not testify that he did not commit the act he was accused of.
Note too, the lawsuit was a defamation lawsuit over him maligning Carroll by claiming she was lying, not whether or not he had committed the act. So the judge basically said the circumstances were such that he could say what he wanted about the defamiation, but could not testify the act did not happen, or anything along those lines - i.e. could not claim she was lying, implying it never happened.
Essentially, it seems to me (again IANAL) he is limited to saying it did not really hurt her reputation, she did not suffer, etc. The lawyer was limited to asking if he stood by his deposition (which claimed she lied) which seems to be as close to saying so as they could get.
As for the general thrust of the OP’s question -
Most sexual assualt is not the “dragged into a dark alley” situation, it’s two people in a setting where the assault can happen, and the man claims she consented or it did not go that far. The line for criminal conviction is “beyond a reasonable doubt”, so the jury has to be really sure it happened.
There are plenty of defences. The presence of corrobrating evidence helps - kind of hard to deny something happened if there is semen in evdence with matching DNA. It may be hard to deny force if the victim is badly bruised. That she told someone about near that time helps, in those cases where the charges surface much later.
I suspect the problem is the jury - a defense lawyer typically tells his client not to testify, for good reason. The defense of “it never happened” or “she consented” would depend on the relative credibility of the witnesses. The defendant (or anyone) cannot say things that are provably false. Saying things that are less believeable will turn the judge or jury against that person and subtract credibility from other aspects of their testimony. Atttacking the other person can backfire, depnding on how it is phrased. But AFAIK, there is no limit other than the risk of perjury to what excuse one can use when the issue under litigation is whether it happened.