Markey and Kennedy are not terribly different: Massachusetts liberals and career politicians. They'll respond to their constituencies and to the political climate. Markey has some of the bad votes common for Dems with long Congressional careers (crime bill, Iraq war, Patriot Act) but avoided some of the others (Reagan and Bush tax cuts, welfare reform, DOMA). An Irish Catholic baby boomer being antiabortion in the 70's is really not that shocking, and it's more relevant that he's had a 100% from NARAL for two or three decades straight.
On balance I think Markey's probably a better bet for the next six years. He's further left in the Voteview and Govtrack rankings for whatever you think that's worth. Kennedy was mostly trying to differentiate himself on constituent services while Markey's signature issue is leading on the GND.
But even if they were totally interchangeable, it was important for Sunrise, Our Revolution, AOC etc. that they get the win here. They planted their flag in a high profile fight and after this (and the challenges to the Squad members) they can credibly promise to protect incumbents who sign on to their agenda. That might be leaving out a lot of the story of the election, but loudly taking credit for good results is something interest groups do.
What lessons to take from this? Primarily, that politics Twitter is deranged and disconnected from reality. But also that center-left politicians will support a progressive agenda if you can make it worth their while.