As comedies go, “The Campaign” is reasonably funny, though it doesn’t even approach the great things its stars, Will Ferrell and Zach Galifianakis, have done in the past. As political satires go, it’s broad and obvious, seldom clever. It starts with Ferrell’s character, a fatuous four-term Congressman from North Carolina named Cam Brady, going over his talking points with his campaign manager, Mitch (Jason Sudeikis), right before a public appearance:

CAM: America, Jesus, and freedom.
MITCH: And what does that mean?
CAM: S*** if I know. I just know people love it when I say it! How’s my hair?

In another scene, Cam’s attack ad smears his opponent on the basis that he has a mustache, and so did Bin Laden and Hussein. That’s an absurd, bottom-of-the-barrel charge for a political commercial to make … but it’s not a very original comedy idea, is it? (Fortunately, it leads to a response ad that’s even more shameless, followed by a reply that’s as hilariously ludicrous as you wish that first one had been.)

So, yeah. We’re not quite at the basic Jay Leno level of “har har, politicians are shallow double-talkers!” humor, but sometimes we’re dangerously close. And sometimes the screenplay, which was written by Chris Henchy (“Land of the Lost,”“The Other Guys”) and Shawn Harwell (HBO’s “Eastbound & Down”), comes right out and states its points in clear, unhumorous language: the Citizens United v. F.E.C. Supreme Court decision enables corporations to buy elections, we need campaign-finance reform, and so forth — valid points, perhaps, but do you have to be so wonky about it?

Aside from these momentary lapses and some third-act stuff that wants us to take the characters far more seriously as human beings than we’re capable of doing, “The Campaign” is an effective vulgar comedy about two idiots competing with each other. Cam Brady, a family man with a picture-perfect blonde wife (Katherine LaNasa), two kids, and at least one mistress, is used to running unopposed for his seat in the U.S. House of Representatives. His constituents in North Carolina’s 14th district expect little of him, and he gives little in return. Along come the billionaire Motch brothers (Dan Aykroyd and John Lithgow) — modeled on the Koch brothers, obviously — who select and fund an easily pliable candidate to unseat Brady, with the expectation that the new guy will be in their pockets. (Why Cam Brady is not already in their pockets is not clear. He’s certainly the type who would be.)

The Motches’ choice is Marty Huggins (Galifianakis), an effeminate, sweater-vested small-town booster who comes from a well-connected family. (His father is played by Brian Cox, so you know he’s serious.) Marty is awkward, effusive, and honest. His slogan is that he’s going to take a broom to Washington D.C. because “It’s A Mess!” Even as an imbecile, he’s able to compete with Cam merely by making statements that are mildly substantive, as opposed to Cam’s utterly substance-free talking points. Cam, petulant and childish in the traditional Will Ferrell fashion, is mad that someone’s making him work for his reelection. Now it’s a real contest!

You would assume at first — indeed, I believe we are supposed to assume — that Marty is gay. But no, he’s just prissy. He has a dumpy wife (Sarah Baker) and two chubby children. The film makes light of their unhealthy eating habits and naively PG-rated dinner conversations, and usually treats them like buffoons. Which is fine, because everyone else is a buffoon too. If Marty and Mitzi Huggins are the fat, uneducated corner of the Republican base, Cam and Rose Brady are the ruthless, hypocritical corner: publicly folksy and religious, privately venal and blasphemous. The Hugginses actually believe in Jesus; the Bradys only pretend to. Everyone gets the same harsh, slightly mean-spirited treatment.

The problem comes later, when we’re suddenly asked to think of Marty and Mitzi Huggins as real people who deserve sympathy. After deploying some brutally dark humor at their expense, now “The Campaign” shifts gears and wants us to consider the actual repercussions. The Bradys, too, must learn lessons. This sharing and growing rings false, and it slows down what is otherwise a nimble 85-minute movie.

The director is Jay Roach, who made the Austin Powers movies and “Meet the Parents,” as well as HBO’s fact-based political films “Recount” (about the 2000 presidential election) and “Game Change” (about Sarah Palin). He has been more widely praised for his work in the latter category than the former, and “The Campaign” reflects a certain political seriousness under all the crass humor and comedy of ignorance. I laughed at Ferrell and Galifianakis, and Sudeikis and Dylan McDermott are sharp as the two sides’ campaign managers. There’s some solid material here. But it might have been better if it had focused on comedy first, politics second, rather than the other way around.