The outcome in Mississippi adds to a national pattern in which Democrats are making legislative gains in red states.