Boston will receive nearly $10 million in federal funds to train workers for jobs aimed at helping coastal areas withstand the effects of climate change, including construction, emergency preparedness, water utility management and community outreach.