The pope has emerged as an increasingly lonely moral voice against perilous global trends like nationalism and populism.