Assume that $X = bE + (a-b) I$ and $Y = d E + (c-d) I$, where $E$ is an $r\times r$ matrix of all ones so that $E^2 = rE$ and $I$ is the identity matrix and $a \geq b \geq 0$ , $c \geq d \geq 0$.
Compute: $(X)^{1/2} Y (X)^{1/2}$
Assume that $X = bE + (a-b) I$ and $Y = d E + (c-d) I$, where $E$ is an $r\times r$ matrix of all ones so that $E^2 = rE$ and $I$ is the identity matrix and $a \geq b \geq 0$ , $c \geq d \geq 0$.
Compute: $(X)^{1/2} Y (X)^{1/2}$
(Presumably $rb+(a-b)\ge0$, otherwise you need to clarify the meaning of $X^{1/2}$ first.)
Since $X$ and $Y$ commute, so do $X^{1/2}$ and $Y$. Hence $X^{1/2}YX^{1/2}=XY$.