Hubert Hurkacz secured his second Masters 1000 championship by triumphing in a thrilling showdown against Andrey Rublev in the final of the Shanghai Masters final.