I did a little digging, and I am guessing that it was a trolley line. I took a look at books by Ronald Karr and Robert Lindsell, both great resources about old lines in New England, and found nothing. The maps in both books show the line from Salisbury to Amesbury, but nothing east to the beach. I even found an old Eastern RR map from 1872 and nothing shows.
I found a reference to a book by OR Cummings, 1965 edition of "Volume 2 , Trolleys to Salisbury Beach, Mass Northeastern St RY Merrimac Division". The description references "...Salisbury Beach Street Railway and its predecessor, the Sea Side Railroad."
I also found this nugget in the Salisbury history web site: "In 1840, the Eastern Railroad was extended to Newburyport and then extended across the Merrimack River to Salisbury shortly after. In 1846-47, a short secondary branch line, running parallel to Elm Street, led from the main line to East Salisbury." Not familiar with East Salisbury.
You could also check with the Salisbury Historical Society.