On the northern edge of Jamaica Plain (east of Brookline in Boston proper), there's a pretty stark example of Brookline's accumulated advantages. On the Boston side of the pond that separates the two, there's Jamaica Way. It's a four lane road with few pedestrian crossings, and drivers regularly going way over the 25mph speed limit. The multi family housing on the Boston side is significantly cheaper and denser as well. It too has a trolley (the E branch of the Green Line), but unlike the Brookline side, the trolley on the Boston side isn't grade separated, so it's quite slow. It also typically runs older rolling stock.
I went to school at Northeastern and so spent plenty of time in that neighborhood. We actually looked at buying in Jamaica Plain because of the price difference. Ultimately we didn't because our kids had grown roots in Brookline and the Jamaica Way was too much of a barrier between the neighborhoods.
I think the biggest difference in the price between the two neighborhoods is the schools. Once you cross over the border (either into JP, or the less segmented allston) the prices drop. Brookline's got well-regarded schools (though they've been coasting), whereas Boston is a mixed bag with a lottery system.