From videos, it seems like the UX's interior space isn't nearly as usable as the XC40. I don't own an XC40, I'm just in the market for a new car; but before I came across the XC40, I looked at the Rav4. There's a lot to like about the Rav4, but i just really hated what they were doing with that black plastic piece above the wheel well.
It really breaks up the lines, and not in a good way (imo, anyway). That same design language carried over into Lexus, and I think it just cheapens the UX.
I also like that there are a lot more safety features that are standard with the XC40 albeit at a higher price point than the UX or Rav4. I also don't like that Lexus/Toyota don't have android auto, and both my fiance and I are android users.
The UX has great mpg rating though, and odd flex for Lexus...best in class turning radius.