The first one is the same as what you put; A is so far from B, but . - A와 B는 너무 멀리 떨어져있지만
As for the latter, did you want to say "A and B are far from each other."? Then you need to add "서로" to the sentence.
What you put might be correct, but if you wanted to say 'A and B', it would be more natural to add that.
So, "A와 B는 서로 멀리 떨어져 있지만" would be right.