Mr. Mendes will leave as the director of the musical, which has been showing in London's West End since 2013, but will remain on the production team bringing it to New York.