This woman has committed a very big forbidden and illicit Marriage. This marriage is HARAM.
When she got married to the 2nd man (not the 2nd husband), she was already married to her husband even if they were separated for so many years and the process of Khula was already in court.
Assuming, that this women was already divorced from her husband but completing the process of Khula took some time until she get the official document of Khula, then she has to wait for the (eidah)
عدة الطلاق which is either:
3 menstruation courses or
3 months for women in menopause period or
until birth for the pregnant women
So any marriage should be done after these two conditions; she get already divorced & she wait for the eidah
Any marriage before these two completed is a VERY BIG HARAM and she has to leave (not divorce) this man because the relationship between them is anything except marriage. And both of them shall seek for ALLAH forgiveness and the shall repentance from this big sin and guilt.
I would strongly recommend these two to ask the nearest Islamic religious scholar to know what they should do.