Dear student,
As we know that iron reacts with moisture and undergoes rusting so to avoid rusting iron is coated with some other metals.
If the coated metal is more reactive than iron so in that case, metal will react with moisture and iron remains safe from rusting.
In case if the metal is less reactive than iron will react with moisture instead of coated metal hence rusting happens.
Metal A is more reactive than metal while metal B is less reactive than iron.
Iron coated with metal B will undergo rusting faster.
Regards