Some analysts had argued software chief Craig Federighi was the more logical pick for a company scrambling to catch up on AI