Ob-Gyn questions? Ask a gynecologist online.
You are correct that your friend is in an abusive marriage. For him to insist on intercourse when she is raw and it's painful for her is abuse.
I don't think that the continued sex will necessarily put the last child at risk, but I would worry about both the child and its mother after the birth. A man who is abusive to his wife is likely to be abusive to his children.
I think that your friend needs counseling to figure out why she stays in an abusive relationship, or to help her to get out, if that's what she wants.
I understand, and I agree that it's up to her. She' fortunate to have you for a friend.
It doesn't sound safe, but it probably is not hurting the unborn child.