The Boston and Maine's presence in Boston first came about through the Boston & Lowell RR which went into operation between those two cities in either 1834 or 1835. Several stations on Causeway St. The 1857 or so terminal lasted until the 1928 North Station. Became a part of 1894 North (Union) Station.
The Andover & Wilmington, which became the Massachusetts portion of the Boston & Maine obtained trackage rights on the B & L from Wilmington to Boston. The A & W was pushed up to the State Line and connected with the New Hampshire Boston & Maine which connected to the Maine Boston & Maine. (At that time each state chartered railroad projects.) The A & W/Boston & Maine found the trackage rights from Wilmington to Boston unsatisfactory and obtained a Special Act of the Legislature which allowed construction of its own route from Wilmington to Boston, Haymarket Square, line completed about 1847. Haymarket Sq. Station lasted until 1894. Right of way south of Causeway St., grade xings at Causeway & Traverse Sts. sold to Boston Transit Commission and used for trolley and Sullivan-Dudley rapid transit route.
The Fitchburg used the Charles River Branch RR, from Charlestown to Spy Pond as the start of its mainline and opened through to Fitchburg in 1847 or 1849. It was probably opened in segments out of Boston prior to completion all the way to Fitchburg. Gothic terminal on Causeway St. next to Warren Bridge used until Fitchburg trains moved into 1894 North (Union) Station which was probably after 1900 lease by B & M. Converted to in-city freight house and office space and stood until demolished for 150 Causeway St. building.
Eastern opened to Salem 1839 or so and terminus was on East Boston waterfront. About 1853 Eastern secured a right-of-way adjacent to that of its subsidiary - at the time - Grand Junction RR and built from Revere to Boston and constructed a terminal on Causeway St.
I might be off a yr or two on dates because I don't have my sources. Find: Baker - Formation of the New England Railroad Systems
Kirkland - Men, Cities & Transportation - 2 vols.
Karr - both books on Rail Lines of Southern & Northern New England
Barrett - Boston's Terminals & Trains