Dear Student,
(i) Rusting of iron takes place more when electrolytes are present, as they contain free ions, and conduct electricity also due to the mobility of electrons. So if the mobility of electrons increases, then electrons will be lost in a very easy manner from iron, hence rusting of the metal increases. As saline water contains NaCl, which is an electrolyte, hence, rusting increases in saline water.
(ii) As we know through reactivity series that magnesium is more reactive than iron, and steel hubs of ocean ships are made out of iron, so if magnesium are strapped onto these steel hubs, then it will prevent the oxidation of iron, hence preventing iron from rusting.
Regards