Dear friend,
I am not sure that the Church has an official stand on such a situation. Each case is unique.
The fact that they both are your friends would be reason enough to beg off giving them assistance so as not to take sides. You love them both too much. If they have young children, it would be appropriate of you to express your pain in depriving the children of a family household. You love the children too much.
If it is a matter of abuse, then such assistance could be acceptable. But for friends, this is still very delicate territory. The professional relationship between attorney and clients regarding divorce is better left to individuals who are not emotionally involved in any way. You could make this known to them, should they ask for your help.
Fr. Vincent Serpa, O.P.