A UK seaside resort once dubbed a "social mobility coldspot" has been given a major boost after securing nearly £20m of government investment.