I’ve always been of the mind that Brainiac is the most intelligent of the two (especially after the upgrades made in Action Comics 544-my favorite Brainiac), but that Luther is more dangerous for Supes because of his single minded obsessive hatred for Superman.
Smarter, Brainiac without a doubt.
Dangerous, I would go with Luthor. Not necessarily because of his obsession, though that helps, but the fact that he’s human, and he’s well connected.
Think about it, Brainiac has access to dangerous technology, but he’s a threat that everyone on the planet Earth can agree on. He wants to bottle up one of our cities and blow it up, even the most contrarian folks on the planet can agree that Brainiac should be taken down by Superman.
But Luthor? He’s a philanthropist. He’s the poster boy for American industry. Most importantly, he is smart enough to leave just enough plausible deniability, and what he can’t do, his team of lawyers and lobbyists and bought city officials can handle the rest.
Brainiac can be defeated satisfactory by beating him up, throwing him into the sun, whatever. But even when Superman beats Luthor’s schemes, he has to watch him weasel his way out and looking better than he did before.
Luthor always wins. He’s an average (well, as average as you can be in a world with talking gorillas and people with light-up rings that run on emotion) dude who regularly goes toe-to-toe with a sun god from Kansas (Grant Morrison wrote that as a description of Superman and I cannot express how much I love it).
Brainiac on both counts.
He is absolutely smarter than Lex.
Depending on the incarnation, Brainiac is devoid of emotion or attachment. Sure Lex can weasel his way out of legal woes, but he can also be reasoned with, relative to his humanity. Brainiac is like Batman, if it doesn’t serve his mission, you can’t reason with him or tug at his humanity. He is Superman’s 2nd greatest foe, with Darkseid topping the list, of course. Lex is a very distant 3rd. Superman’s greatest power is his heart, his love of humanity and its potential. Neither Brainiac or Darkseid give a rats about humanity and are totally heartless.
It’s like @Jay_Kay said: everyone knows he’s a threat and has to be shut down ASAP.
Luthor is a major threat too, but he’s not willing to destroy the Earth to satisfy his own desires (most of the time at least) like Brainiac would.
Corporate Luthor cares about having a good image, will manipulate the public for his own benefit and wants his cut.
Brainiac doesn’t care about any of that. He just wants to hoard knowledge and destroy things so nobody else can have what he does.
They have similarities and have worked together on various occassions, but Brainiac is the one who would wipe his robotic feet all over humanity and then some to satisfy his own arrogance.