The Democratic lawmaker, who had served in the chamber since 2003, was seeking a 13th term in his safely blue district.