Why does magnesium deposit during electrolysis of a molten mixture of MgI2 and AlBr3?
Yes, it is true that you cannot use the standard electrode potential to determine which cation would be reduced and vise versa during an electrolysis of mixed molten salts, in your case, $\ce{AlBr3}$ and $\ce{MgI2}$. That's because most tabulated values of standard electrode potentials are determined for aqueous solutions. Therefore, they can be used only as approximate guidance. Instead, electronegativity values (EN) can be used to estimate the stronger oxidizing and reducing agents. For example, EN values of $\ce{Br}$ and $\ce{I}$ are 2.8 and 2.5, respectively. Therefore, we can conclude that $\ce{I-}$ is the stronger reducing agent between two elements (because $\ce{I}$ is less EN than $\ce{Br}$). Similarly, between $\ce{Al}$ and $\ce{Mg}$, $\ce{Al^3+}$ is the stronger oxidizing agent because $\ce{Al}$ is more EN than $\ce{Mg}$ (1.5 vs 1,2, respectively), so $\ce{Al^3+}$ gains electrons easier.

Therefore, possible cathode half-reaction (reduction): $\ce{Al^3+(l) + 3e- -&gt; Al(l)}$
And Possible anode half-reactions (oxidation): $\ce{2I-(l) -&gt; I2(l) + 2e-}$