People in coastal communities have poorer access to health and social care services than those living in towns and cities.