Her triumph in a chunk of Massachusetts once represented by Tip O’Neill shows that the former House speaker’s maxim no longer applies.