Choose XR. There’s a reason Apple discontinued the X instead of marking it
The reason is because XS is the replacement and X is too premium to make for lower prices. This happened with iPhone 5 too.
It’s not because XR is “better”.
With that said, XR has a faster cpu, better speakers and better battery life, better single lens camera.
X has a more premium build with smaller bezels, better screen and a dual lens camera.
Which one is better really depends on what you’re looking for in a phone. For most people, XR probably.