There are certainly some parallels between the Federation and the European Union -- the most obvious being that it's a union of many different cultures comprised of pre-existing states that chose to join the union and work together in cooperation.
There are a lot of important differences, though. For one thing, the fundamental function of the European Union is to try to end the problem of intra-European wars; whatever else its faults or failures, it's made the idea of an intra-European war virtually unthinkable -- the idea of France, Britain, or Germany going to war with one-another again is today absolutely absurd, and that makes it a definite success story.
On the other hand, there are some very important differences. The most important being that the European Union is not a true
state; it is, rather, an association of states that has been delegated from its Members some (but not all) of the functions of a state. It does not, for instance, have the ability to declare war, nor can it control its member states' foreign policies -- that's why 2003 saw some European Union member states supporting and participating in the Iraq War (the United Kingdom, the Kingdom of Spain) while others condemned it and refused (the French Republic, the Federal Republic of Germany). The other important thing to remember about the European Union is that while there is the European Parliament, ultimately the E.U. obeys the
governments of its member states rather than the
peoples of its member states; that's why the Council of the European Union and the European Council are composed of ministers or heads of government or state from the member states.
Perhaps most strikingly, though it has a common high court, the European Union lacks its own military or
gendarmerie. In other words, the European Union lacks the monopoly on the legitimate use of force within its territory, which is perhaps
the defining trait of a state.
The United Federation of Planets, by contrast, seems to be just that -- a
federal state. We've seen someone identified as the President of the United Federation of Planets in
Star Trek IV -- incidentally, he is
not identified as the President of the Federation Council in dialogue. We saw in
Star Trek IV a later Federation President conducting foreign policy on behalf of the entire Federation, without any need to gain the support of Federation member states' governments. In TNG's "Force of Nature," we hear that the Federation Council has banned Federation ships from traveling above Warp 5 in order to help preserve the fabric of space-time, establishing the Council's legislative authority over Federation territory. In DS9's "Homefront," we saw the Federation President place a Federation member world, Earth, under a state of emergency, placing armed forces loyal to the Federation rather than Earth throughout Earth's territory -- a
strong indicator of Federation statehood, as this is the sort of power that alliances and intergovernmental unions lack.
We also discovered that the Federation possesses a Supreme Court in "Dr. Bashir, I Presume?," which seems to possess supreme appellate jurisdiction given its supposed power to overturn Federation laws against genetic engineering. The Federation's ban on genetic engineering itself is another indicator of legislative authority possessed by the Federation.
Perhaps most tellingly of all, however, the Federation seems to possess (along with its member states) the monopoly on the legitimate use of force within its territory (just like federations today do). The Federation operates its Starfleet, which conducts national defense on behalf of the Federation (the military). In
Star Trek III we saw Dr. McCoy being arrested by a civilian law enforcement agency called Federation Security -- apparently the Federation's gendarmerie. So the Federation goes to war when the President and Council say so, not when all 150 members agree to it, and it conducts its use of force through organizations loyal to it rather than to its member polities.
Now, it's important to bear in mind that the Federation
does share powers with its member states as a federal state would. Individual Federation members seem to have a wide variety of legal practices, for instance. But the preponderance of evidence seems to me to be that the Federation is a federal state rather than an intergovernmental organization like the European Union.
ETA:
I do think it's important to note, however, that many people believe that the European Union is in the process of, and will one day successfully, evolve into a state in its own right.
FWIW, the government of United Earth (in Trek) is a mixed system, it has a President (head of state) and a Prime Minister (head of government). But the EU appears to be much more complicated than that.
That's not necessarily a mixed system at all -- it just means that it's a parliamentary republic rather than a constitutional monarchy. There are numerous parliamentary states today that possess both Presidents and Prime Ministers -- the Federal Republic of Germany, Ireland, the State of Israel, the Italian Republic amongst them. Though the specific English term "Prime Minister" might not be used in favor of equivalent terms like "Federal Chancellor" (
Bundeskanzler in German),
Taoiseach (Irish Gaelic for "Prime Minister"), "President of the Council of Ministers" (
Presidente del Consiglio dei Ministri in Italian), "Head of Government" (
Rosh Memshalah in Hebrew), or what have you. But the meaning is the same -- the member of the parliament (MP) who has the confidence of the majority of MPs (usually the MP who leads the majority party), appointed to serve as the head of government (real leader of the country) by the head of state (ceremonial leader of the country) on the basis of that confidence.
In these systems, the President is a mostly ceremonial position, and real power is in the hands of the Prime Minister, who makes all the decisions and advises (which is parliament-ese for "orders") the President to undertake certain policy decisions. It's really just like the British system, except the Queen is replaced with a President.
A truly mixed system would be something like France's semi-presidential system, where the relationship between the President and Prime Minister varies from person to person and situation to situation, and where sometimes the PM is the head of government and other times merely the President's chief lieutenant and the President the head of government.
The various
Trek novels -- particularly the ENT Relaunch,
A Less Perfect Union, and the short story "Eleven Hours Out" -- have established that the real leader of United Earth is the Prime Minister. The
Corps of Engineers novel
The Future Begins established the existence of a President of United Earth -- and the character so identified as a historic U.E. President has since appeared in the ENT Relaunch -- but so far the evidence seems to indicate that United Earth is a typical parliamentary republic a la Germany, Ireland, Italy, or Israel.