Is the EU undemocratic? I don't think so...here's why...
Election of representatives
European Council - Prime Minister or equivalent of each EU member state is automatically a member, thus indirectly elected by the public
EU Parliament - MEPs elected by public vote
Council of the EU - Relevant ministers automatically appointed from each EU member state, thus democratic accountability varies
House of Commons- MPs elected by public vote
House of Lords - Lords selected by leaders of parties, or by pre-conferred "right" to sit in the House
Formation of "cabinet*"
European Council - The European Council is it's own cabinet, so is indirectly elected by the public
EU Commission - Council of Europe and President have discretion over who is in the commission, but must be approved by the EU parliament
UK - Prime minister has sole discretion over who can be in the cabinet
Election of political "heads of state**"
EU President (colloquial term) - Elected by representative body of heads of EU member states
Commission President - Elected by representative body of heads of EU member states, and further ratified by the EU Parliament via a vote (second election of sorts).
Prime Minister - Elected by unrepresentative body of members of a single party
Removal of political "heads of state"
EU President - able to be removed from office by super-majority (not just over 50% of the votes, currently over 75%) vote of heads of EU member states at any time
Commission President - Can be removed through a vote of no confidence by the EU Parliament
Prime Minister - Only removed through fixed term changes of party in power, or prime minister's choice to stand down
Powers of political "heads of state"
EU President - Cannot make policy, can only help bring consensus on discussions
Commission President - Controls most of the policy agenda for the EU, policy must be voted on by Council of Europe and EU Parliament
Prime Minister - Controls most of the policy agenda for the UK, policy must be voted on by House of Commons and House of Lords (though House of Commons can force the House of Lords to be ignored).
So in the UK we elect one chamber out of two, this helps to decide who is the person that chooses our policy direction (though that person is elected by a tiny subset of a completely unrepresentative sample of the UK population). This person, along with other party leaders modify who sits in the second chamber, the House of Lords. The Prime Minister then decides who he or she wants to help him form policy, and that group of people entirely unelected by the people put forward new laws. These laws are voted on by those MPs we voted for directly, and then by Lords whom we have had no say in their "make-up".
We can't get rid of our Prime Minister, our MPs can get rid of our Prime Minister with a super-majority (which means those who are in the party of the prime minister would also have to vote them out), and so effectively the only way to change our policy direction is for the Prime Minister to volunteer to stand down, or to elect a new government at the next election.
By contrast the EU system is more complex, but more democratic. The European Council is made up by political heads of state, and as such the nations interest on the European Council always reflects the current wishes of that nation's public as of the last general election. The EU Parliament is directly elected just as our House of Commons is.
Comparison: The European Council is a psuedo cabinet for the whole EU, but unlike the UK where the head appoints his cabinet in a top down fashion, the EU functions on the indirectly elected heads of each country deciding who their President will be. A more democratic situation. The EU parliament is very similar to the UK, MEPs elected by the people, and a second chamber that are appointed. The difference is that the Council of the EU is still supposed to be representative of the will of each member state (since the minister involved at any one time should be following that country's policy direction). The House of Lords is representative to no-one, though supposedly should be representative of the power balance in the Commons. This too is very slightly more democratic in the EU, though could be counted as more democratic simply through MEPs being elected in a way that ensures a much closer accuracy to people's political beliefs through proportional representation.
The European Council decides who should be the EU Commission President and the European Council President (The former more like a "Prime Minister" the second more like a "President" though without the wider powers), they do this with a democratic vote in a system designed to try and forge a unanimous decision. The Commission President then needs to be ratified by EU parliament.
As said above, the presidential role in the European Council is a bottom-up appointment. As for the Commission President, unlike our Prime Minister who is only determined by members of their party, the Commission President has to be approved by both the "Cabinet" of the EU, AND your elected representatives in Europe.
In short, the systems in the EU are fundamentally more democratic than our own in the UK, and where there are potential weaknesses in the EU on the front of democracy it is only because individual member states (like the UK) have poor democratic structures when considering integration in to Europe, and because Europe does not tell those member states what they most democratically achieve to be included in it's processes.
*It's worth thinking about the Council of Europe as a small version of our House of Commons, with each head of state being an MP. They automatically have a say in policy direction in some areas for the EU, and if anyone else such as the High representative of the Union for foreign affairs and security policy is elected in to this sphere of "cabinet member" by super majority, though they have no voting rights. A Cabinet in UK terms is the body of people that decide policy direction for the country.
**I'm fully aware the Prime Minister isn't technically our head of state, but for all intents and purposes (s)he is to be regarded as one.