You're right. Poor Y is definitely the loser in both cases. And personally, I thought he was so much better.
Maybe there's a slight difference in the effect on a reader. X beat out Y suggests an active X, who vigorously threw himself into the tryouts for the role. Y lost out to X is a more general description of the result.