Medvedev battles back to win second title of year