In the dreamlike world of “The Double,” things aren’t as bad as they seem. They’re much worse.

The film is a nail-biting comedy where deadpan humor and dismay are near neighbors. It’s set in a macabre retro world of Soviet-style one-size-fits-nobody clothing and creaking, outdated subway cars. Outside there’s weather that might have been whipped up by Edgar Allan Poe. Inside are purgatorial offices where aged bureaucrats perform vague but disagreeable tasks in hopes of winning favor from the legendary CEO, the Colonel (James Fox).

This is the universe of Simon James (Jesse Eisenberg), a meek functionary. When Simon briefly removes his suit coat at work, he is chastised by his superior, “Put your jacket on, son, this isn’t a brothel.” He’s lucky to have that fleeting attention: No one else recognizes him, despite seven years on the job. Simon’s sole claim to distinction is that his neighborhood is No. 1 in the city for suicides. Investigators following up on the latest jumper ask if the twitchy Simon is thinking of killing himself. When he answers “no,” one of them says, “Put him down as a maybe.”

Such is the pitiless and very funny comedy of misfortune constructed by director Richard Ayoade and his co-writer Avi Korine. They have created an eccentric world with a keen sense of what passes for normal. Underground rumbles are so commonplace that no one pays them any more heed than the passing off-camera screams. The color palette runs the gamut from drab to grimy. The atmosphere is so oppressive that we forgive Simon for telescope-peeping on the girl across the courtyard from his apartment. Under the circumstances, his voyeurism feels like a minor vice.

The girl (Mia Wasikowska) works in the office copying division, operating duplicating contraptions the size of a minivan. An ineffectual flirt, Simon can’t catch her eye.

But she lights up in the presence of hotshot newcomer James Simon (Eisenberg again, yet entirely different). The new arrival is Simon James’ physical twin and personal opposite. A glib backslapper and back-stabber with a genius for self-promotion, James takes credit for Simon’s unrecognized work, in return tutoring him on how to approach women. Their partnership ruptures when James sets his sights on the woman Simon has been fruitlessly pursuing.

Eisenberg is utterly persuasive in his dual role, giving each character a demeanor and physical style so distinct we’re never in doubt who’s who. He’s made a great heel before (think of his techno-tyrant Mark Zuckerberg in “The Social Network”) and a memorable nebbish (“Zombieland,” to pick at random). Acting against himself, he’s breathtaking; his scenes of failed courtship with Wasikowska are pure, distilled discomfort.

Ayoade’s film works on several levels. It succeeds as comedy, as a creepy psychological study and as an unnerving acknowledgment that most of us are fairly anonymous cogs in the world’s vast, clunking machinery.

Its biggest weakness is a half-strength. The production design is bizarre in the manner of Terry Gilliam’s “Brazil,” impressive yet nakedly derivative. The same sort of debt overpowered Ayoade’s youth romance “Submarine,” which borrowed unabashedly from Wes Anderson’s look and tone. Ayoade has proved that he can cut his work to an established pattern. It’s time for him to create one all his own.