Yes, OP that's a shitty situation. Been there. All I can say is be a good friend, and who knows what can happen if they are not married, and maybe not all that solid, maybe that relationship will run its course, and who knows what could happen, but don't try and actively undermine the relationship. Because you will be shot down hard, and kiss the friendship goodbye.
And if you can't emotionally handle just friendship, then maybe just keep distance altogether. Don't get all emotionally invested either way, as your chances really aren't good here. Plenty of fish, ideally find one without baggage.