Explanation:
The brightness of star depends upon two factors
1. Luminosity
2. Distance from the earth.
Luminosity is the amount of energy emitted by the star in unit, greater the luminosity greater will be the brightness. However, Stars that are closer to Earth, but fainter, could appear brighter than far more luminous ones that are far away.
Therefore, star can either be closer to earth or more luminous than star Y or both.