The leaders of Boston, Chicago, Denver and New York testified for hours before a largely hostile House committee that accused them of abetting violent migrants.