In compound x2y, the percentage mass of x is 60%. The percentage mass of y is 40%. Let the compound weigh M, 2 units of x weigh 0.6M, 1 unit of x weighs 0.3*M and one unit of y weighs 0.4*M.
In the compound x2y2, the percentage mass of y is 0.4*2/(0.4*2 + 0.3*2) = .8/(.8+.6) = 0.8/1.4 = 57.14 %
The percent by mass of y in x2y2 is 57.14%.