British Prime Minister Theresa May congratulated Mr. Trump publicly before Mr. Obama did.