BUDAPEST — Faced with what critics say is an alarming drift away from democracy by one of its members, the European Union gave the Hungarian government a final warning Wednesday that it would face the start of formal legal action by next Tuesday unless it modified a series of measures that threaten the balance of power in the country.