Urban cores across the US are attracting an outsized share of young and educated residents, even in cities where the overall economic picture is gloomy.