Nanoscale polarization relaxation in a polycrystalline ferroelectric thin film: Role of local environments