All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
This second marriage contract is void since it was made with a married woman and it is a great sin. If the second man had sex with her, then she committed adultery.
Therefore, she should make sincere repentance for what she had committed even though she still remains as a wife of the first husband. She can marry only when he divorces her. If he abuses her and denies divorcing her, she can sue against him in a court if she is in a Muslim country. Otherwise, she may give some amount to get a divorce from him. After the divorce, she should observe a waiting period (‘Iddah), and only then can she marry another husband.
Allah knows best.