If your friend actually
is moving away then that would make it 100% easier, though I cant say for certain from the post.
If not, then I'd talk about it with the guy first. Chances are he'll back off happily leaving the two of you in the clear. After a wee while of her not getting attention from the guy she'll probably have a little greater perspective on things and be more open to accepting you as more than a friend, or a friend-with-benefits. Even if, in the end, she does have some unconquerable crush on the guy at least you can move on.
I think you're probably going to get the girl, but good luck either way.