A series of setbacks for Republicans leaves an unlikely opening for Democrats to narrowly win this year’s redistricting wars.