Nikoloz Basilashvili outlasted Andrey Rublev to lift the German Open title for a second successive year.