NAIROBI, Kenya—A deadly orchestrated attack by Islamist militants on two popular seaside restaurants in Somalia’s capital is the latest reminder that they have been far from cowed by African Union troops and U.S. drone strikes against its leaders.

At least 14 people were killed late Thursday when a group of gunmen from the armed group al-Shabaab exploded a car bomb near two seafood restaurants along Mogadishu’s Indian Ocean waterfront. Another group of gunmen stormed the restaurants from the beach, according to Somalia’s...