The maximum voltage can be produced in the cell which have higher difference in the electrocemical potential , in this case it would be most reactive magnesium and less reactive platinum...magnesum spontaneously gives its two electron and Pt takes its two electron.... as result generates the highest voltage