Russia beat Italy in the ATP Cup final after Daniil Medvedev and Andrey Rublev both won their singles matches.