WTAF I cannot fathom why any kind of coerced disclosure is either necessary or acceptable! There are any number of reasons why people choose not to disclose personal information such as sexuality, marital status or religion at work and I'm fairly sure our privacy is protected by law.
If I had to go to this training, if dissent was not an option, I would plan to do the same as you - keep my mouth shut, my head down and patiently wait for it to be over.
However, if they coerce you in this fashion, it'd be much harder for me to keep my thoughts to myself. Disclosure is voluntary only where we do not feel peer pressure to disclose and where we do not single ourselves out by refusing.
This is why disclosure in such a setting is generally a bad idea. It's not spontaneous, it's not need-based and it serves no purpose that benefits the person making the disclosure or someone they wish to support.
I would probably just state my name calmly and sit down again. If the trainer then asks any question 're pronouns or sexuality, I would probably just say that I keep my private life private thank you for asking though and stare them down.
If they keep going after that, I would flatly state that I consider their intrusion into non-work related aspects of my life to be harassment and wildly inappropriate and that I will be putting in a complaint about this.
Also, a legal eagle told us at a meeting recently that asking how their training interacts with existing safeguarding procedures is an excellent question to safely throw a little spanner in the works. Followed by a complaint identifying any conflicts with existing safeguarding rules. I know from others that some of these complaints have been successful.
But obviously only where you feel safe to do so.