The Nokia 5.1 is a better phone as it gives a little better specifications at a similar price.
Let's see the specifications-
Camera: The Nokia 5.1 has a camera of 16 MP with F2.0 aperture whereas the Redmi Y2 has a camera of 12 MP + 5 MP with F2.2 aperture.
Display: The Nokia 5.1 has a Full HD display whereas the Redmi Y2 has an HD display.
Check Full Comparison Redmi Y2 vs Nokia 5.1