One idea for Newburyport is the Rail Trail, which runs between the commuter rail station and the waterfront. Public art, some of which will likely interest small kids, is installed along the trail, and there is also a playground. It seems like a long drive just for this, though. Plum Island/Parker River Wildlife Refuge in Newburyport is a beautiful beach, but as there is a strong undertow, it's not a good spot for little ones to swim or even splash.
I think the best MA beach north of Boston for small kids is Wingaersheek in Gloucester because of its sheltered location; this means somewhat warmer water temperatures, gentle waves. It has great tide pools, too. However, that will be quite a drive for you!
Closer to Wells, how about the Seacoast Science Center in Odiorne State Park in NH. I think it has exhibits that your 3 year-old will enjoy. And to your north, you could visit the children's museum in Portland (I've never been, so cannot really recommend, those on the Maine Forum can offer more information).
http://www.cityofnewburyport.com/planning-development/pages/clipper-city-rail-trail-and-harborwalk
https://www.fws.gov/refuge/parker_river/
http://www.seacoastsciencecenter.org/