Spatially resolved X-ray study of supernova remnants that host magnetars: Implication of their fossil field origin