Their attendance marks the first time world leaders have been present at a U.S. president’s swearing-in ceremony, a historian said.