Scott Brown, a little-known Republican state senator, rode a growing sense of unease among independent voters to an extraordinary upset Tuesday night when he was elected to fill the Senate seat that was long held by Edward M. Kennedy in the overwhelmingly Democratic state of Massachusetts.