Cr electrode increases in mass therefore Cr3+ is being reduced to Cr. Cr3+ + 3e- -> Cr
X electrode decreases in mass so X is being oxidised. X is 2+ as it makes XSO4 and SO4 has charge 2-. Therefore X -> 2e- + X2+
To combine the equations you need to multiply the Cr one by 2 and X one by 3. Total equation would be 3X... -> 2Cr...
Therefore Cr:X is 2:3.
I assume the top line 'question is about d-block metals' refers to the rest of the question which is why they used Mg which isnt a d-block metal.