I'm on the fence. They can work out, but only if both people are willing to make it work. You need to have an incredible amount of trust and be creative with how you express yourself to each other. And of course it'll only last if someone is willing to move closer to the other. If you don't have that, there's no chance it's going to work out.
Its funny because I just broke up with my long-term girlfriend who lives half way across the world in Ireland while I'm in Puerto Rico. I moved here about a year back and we decided 2 continue the relationship for as long as possible tbh.
It was much too hard not seeing each other for 5-6 months and so we decided 2 end things. Maybe it might work if you guys are only apart for a little while. But otherwise no