Kei Nishikori ended his three-year title drought to triumph at ATP Brisbane, beating Daniil Medvedev 6-4 3-6 6-2.