Democratic mayors say they ‘would be prepared to welcome undocumented immigrants as they have for decades’.