Your own two interpretations are actually the opposite of what you're calling them. The first version without the commas are restrictive, while the second version with the commas is nonrestrictive.
The original sentence is a nonessential appositive. You can tell because of the parenthetical commas.
Without the parenthetical information, it would read:
The men at the shop are helpful.
The sentence can be understood without the extraneous information that John knows two of them.
To turn it into an essential appositive, the commas would need to be removed and the sentence slightly rephrased (which would also change its meaning):
The two men at the shop who John knows are helpful.
Here, it's specifically talking about the two men—not just men in general who happen to include those two.
Update: Alternatively, you can alter the sentence even more in order to keep the same meaning—but it would also remove its appositive nature:
Among the all-helpful men at the shop are two whom John knows.
From the Purdue Online Writing Lab:
An appositive is a noun or pronoun — often with modifiers — set beside another noun or pronoun to explain or identify it.
Here are some examples.
The popular U.S. president John Kennedy was known for his eloquent and inspirational speeches.
Here we do not put commas around the appositive because it is essential information. Without the appositive, the sentence would be, "The popular U.S. president was known for his eloquent and inspirational speeches." We wouldn't know who the president is without the appositive.
John Kennedy, the popular U.S. president, was known for his eloquent and inspirational speeches.
Here we put commas around the appositive because it is not essential information. Without the appositive, the sentence would be, "John Kennedy was known for his eloquent and inspirational speeches." We still know who the subject of the sentence is without the appositive.
Update: This is based on the confusion between the words used to describe the sentences in this question.
I have used nonessential appositive and essential appositive.
Another answer has used non-restrictive relative clause and (I'll assume, although it is not explicitly given) restrictive relative clause.
Here is an excerpt from an article by Tim Stowell called "Appositive and Parenthetical Relative Clauses" (direct link to a PDF).
Appositive relative clauses differ from restrictive relative clauses in a number of ways. The fundamental distinction is semantically based: an appositive relative like that in (1a) conveys an independent assertion about the referent of its associated head; the reference of the head is established independently of the appositive relative. In contrast, a restrictive relative like that in (1b) is interpreted as an intersective predicate modifier, restricting the reference of its head.
(1a) The prince, who was wounded, withdrew from the battle.
(1b) The prince who was wounded withdrew from the battle.
This linguistic article uses yet a different set of terminology: appositive relative clause and restrictive relative clause.
So, now we have three different sets of terminology to refer to the same pair of sentences. But debate around which is the "correct" terminology takes away from the main point.
If you use parenthetical commas, then the enclosed information is extraneous to the sentence; if you don't use parenthetical commas, then all of the information is important to the sentence.