This came up in a recent thread.

https://bangordailynews.com/2021/05/...l-to-portland/

The Sebago the Sea trail includes the southern section of this route.

The former rail bed of the Portland & Ogdensburg Railroad, subsequently the Mountain Division of the Central Maine Railroad runs from Portland to North Conway and up through Crawford Notch and west. The big push is for a bike trail but it potentially would be hiking trail to connect up with the Maine coast. Much of it runs through a rural corridor and with some planning I expect someone could find places to camp along the way. Conway Scenic RR leases the track in NH from the state of NH and has rights to the tracks to the Maine/NH border but only actively uses the section north of North Conway up through Crawford Notch. The section from Westbrook to Portland along a coastal estuary is run as a siding to support what is left of the Sappi paper mill in Westbrook. The Portland Trails network parallels some but not all of this section.