Both cannot survive without the other. A good UI can fail if the UX is really not up to the mark and so is the reason why UX is important. Making a super cool interface with all the latest trends and interactions will not really matter if ultimately if the UX or the experience for the user while using it is not up to the mark. Imagine a situation where you have world class visuals for your app, but when it comes to experience, users are not able to understand how to work with your app. Vice versa, a good experience will fail, if it’s not properly translated into a good looking UI. After all the hard work of brainstorming and coming up with a solution to the problem, if it’s not visually made appealing, users may not want to use your application. As you can see, both need the other to survive in the design world.
Similar questions for your reading
1. How difficult is it to be a UX Designer?
2. How important is UX for a product/app design project?