I had the exact same issue for two weeks now. I attempted multiple times un-pair and re-pair my AirPods with no luck to get both to work. I noticed after attempting this multiple times the audio would actually stop working on the AirPod that was previously working (right one would produce audio before un-pairing and then stop working re-paring as the left then would only produce audio).
I solved the issue by leaving the AirPods paired with the sync issue and not up-pairing them. I put the AirPods in their case and pressed and held the sync button on the back with the lid on the case open so I can see the indicator light. The indicator light blinked white and my iPhone 7 recognized the AirPods and gave me the connect screen on my iPhone and I connected allowing both of them to work. It fixed my issue and they have been working ever since.