I think the method you are using of checking correctness by removing clauses does not apply directly to pronoun use, which is probably often processed more left-to-right. I am sure it is more complicated than that, but I will have to defer to an expert on that.
In my opinion, the second one is better. The first one is acceptable, but it could make the reader stop partway through and go back to figure out who "him" is referring to, and it is only non-ambiguous since the reader assumes that Mary is not "him."
If you consider the case where instead of Mary (her), we have Mark (him), the first sentence would be ambiguous or have the wrong meaning, while the second one would be clear and correct.
Clutching his striped tie, sitting on the couch, Mark waited for Tom to come out from the bathroom.
- Possibly ambiguous depending on context, but I would tend to interpret this as Mark holding Mark's own tie (opposite of what is intended).
Clutching Tom's tie, sitting on the couch, Mark waited for him to come out from the bathroom.
- Not ambiguous, Mark is holding Tom's tie.