Was this branch controlled by the Boston and Lowell? I remember reading that B&M built the Lowell Branch to invade B&L territory in Lowell, while the B&L built a t line to Lawrence. Now B&L could invade B&M territory in Lawrence. When B&L and B&M merged, they had 2 routes between the two cities. The B&M Lowell branch survived.
This is similar to some of the branches between the B&M ( Western Route), and the Eastern RR. Both of these companies built branches into the competitor's territory.