Hungary’s new prime minister is using his first foreign trip to signal a break with former leader Viktor Orbán’s Russia-friendly course, with Poland at the center of Budapest’s bid to return to the European mainstream.