President Barack Obama traveled to South Africa on Friday, taking his place amid a national vigil for Nelson Mandela, the country's ailing icon.

Under different circumstances, this could have been the setting for a made-for-the-history-books moment, a meeting of political figures who overcame racial barriers to lead their countries. But as Mr. Obama made his first presidential visit to South Africa, Mr. Mandela remained in critical...