Croatia’s prime minister, Zoran Milanovic, pledged to help the migrants reach western Europe and said Hungary’s razor wire fence sent a “terrible message.”