TOKYO—An opponent of Japanese Prime Minister Shinzo Abe's plan to relocate a U.S. military base in Okinawa was re-elected Sunday as the mayor of Nago, the coastal city on the southern island that was chosen as the next destination for the air base, underscoring the hurdles the undertaking still faces.

The result of the mayoral race, which comes less than a month after Mr. Abe persuaded the Okinawa governor to apply for a landfill permit in Nago that opened the way for the project to move forward, could again put the brakes...