President Andrzej Duda, an ally of the previous administration, swore in the government after delaying the power transition as long as he could.