It is undemocratic when the democratically elected people wants to subvert the democratic order. Most (but not all!) democratic countries have constitutions that actually limit the power of elected people exactly for this reason. Especially those countries that ended up democratically electing dictators on the eve of WWII have constitutions that severely limit the power of the executive.