How exactly would the court determine this to be the cause of divorce?
99.99% of the time, this would be purely a "he said she said" situation, for how can someone prove refusal to engage? You can prove
the opposite if there are children born to both parents, but how can
one prove a negative? Or is the statement by the divorce initiator
considered sufficient for the judge?
Testimony under oath is evidence. Judges resolve "he said she said" situations every day on a routine basis with witness testimony alone by judging the credibility of each witness before them. See also an answer by @Jen about the subject of how things are proved in court in general.
In the appropriate case, testimony under oath with no other corroborating evidence can even support a murder conviction as proof beyond a reasonable doubt. It can certainly suffice to prove marital fault in a civil lawsuit for a divorce.
If the judge finds that witness testimony under oath between more than one witness is irreconcilably different, and each witness is equally credible, and that it is impossible to tell which person is telling the truth, then the person seeking relief from the court has failed to meet their burden of proof to obtain relief from the court.
But, this is rare. Usually, when witnesses are both testifying under oath and disagree about what happened, the judge will find that one witness is more credible than the other.
And, in truth, while people certainly do lie in open court under oath, and probably are more likely to lie in that situation than when speaking to someone not under oath outside of a courtroom, most of the time, people don't lie and the testimony of all of the witnesses are consistent with each other subject to limitations based upon what they could perceive from their perspective and the limitations of imperfect memories.
This could come down to demeanor in court, hesitation in answering, "tells", inconsistencies in their testimony, corroboration from other evidence and other witnesses (e.g. what someone said to a friend or wrote in a diary at the time), evidence that a witness has been convicted of a crime of deceit in the past, use of language that suggests coaching about their testimony, or common sense judgments about whose story seems more plausible under the circumstances of the parties in front of the judge.