Pope Francis has finished his five day trip to Mexico with a mass on the country's border with the US.