Portland International Jetport: The actually useful option is a rental car: Brunswick is roughly 35–45 minutes north via I-295/US-1, depending on where you are staying. There is no simple airport-to-Brunswick rail transfer; without a car, get to Portland’s transportation center and use the Amtrak Downeaster or Metro Breez, but allow roughly 2–3 hours door to door.
Boston Logan International Airport: For a car-free arrival, get into Boston and take Amtrak’s Downeaster from North Station to Brunswick; the through rail journey is about 3¼ hours, then it is a short walk into downtown. It is sensible only if you are already in Boston or do not need to explore the coast beyond town; otherwise rent a car.
Brunswick Station / Visitors Center: Amtrak Downeaster terminates here, with five or six daily trains in each direction to Portland, Freeport and Boston. Portland is about 45 minutes and Boston about 3¼ hours; the evidence package quotes roughly $3 from Portland and $30 from Boston. The station is right by downtown, not an out-of-town depot.
Portland Transportation Center: For a cheaper, slower Portland link, Metro Breez runs about a dozen buses daily between Portland and Brunswick via Yarmouth and Freeport: about one hour, roughly $2–4. Concord Coach Lines is the more direct intercity-bus alternative from Portland (about 35 minutes; quoted at $16 one way), but has limited frequency.