Solution 1:

The confusion arises from the vagaries of English vocabulary and from two similar syntactic forms. Forms first.

  1. Subject Copulative-verb Nominative-Complement

A copulative (or linking) verb is a verb of being or feeling, and it links the complement to the subject, either identifying the subject (if the complement is a noun) or describing the state of the subject (if the complement is an adjective).

[1a] I am John.
[1b] I am happy.

In 1a, John and I are the same person; in 1b, I am filled with happiness.

  1. Subject ( Auxiliary-Verb Past-Participle ) [ by Agent ]

This is the form of a sentence in the passive voice. I've placed the auxiliary verb and past participle in bold parentheses to indicate that they go together to form the predicate. In the passive voice, the subject is acted upon by the verb, and the actor is given as the object of a prepositional phrase with by. I've called the actor Agent, and enclosed the prepositional phrase in bold brackets to indicate that it may be missing.

[2a] I ( am wounded ) by an arrow.
[2b] The President ( is elected ) in years divisible by four.

In 2a, the subject has been hurtfully acted upon by a weapon. In 2b, the subject receives the action of selection for office, but the selectors are not mentioned. We may assume it's voters, and we could supply the missing phrase by the voters.

Confusion may arise because past participles, in addition to signaling the passive voice, may also act as noun modifiers like adjectives. Consider

[3a] I am depressed.
[3b] I ( am depressed ) by events.

3a is like 1b. 3a says that I am suffering from a disease called depression. (I am filled with sad feelings that may have no external agent.)

3b is like 2b. 3b says that external events have acted upon me to make me sad.

But when no agent appears, how do we know which of the templates 1b and 2b to choose? We have to rely on the context. Sometimes the topic makes it obvious, e.g., elections always have agents (called electors or voters) who do the electing. Sometimes it takes knowing English usage and idiom, and that's what it takes for your example.

The OED tells us that the verb to mistake is an old one, with almost 700 years in the language, and originally it had two meanings -- to misidentify and to make an error. But over time, some forms fell out of favor and were no longer used. We no longer say I mistake to mean I made an error. That form is reserved to mean I misidentified as in your example. We say instead I made a mistake for being in the wrong.

The past participle mistaken moved in the opposite direction, and it no longer means I am misidentified unless it's accompanied by a prepositional phrase with for, again as in your example. Alone, it means I am in error.

Thus, if you find am mistaken by itself, it cannot be a passive form of the verb meaning was misidentified, and you must analyze the sentence by the pattern of 1b. On the other hand, if you find am mistaken with a prepositional phrase with for, it must be a passive form, and you must analyze the sentence by the pattern of 2a or 2b, depending on whether the agent is identified in a prepositional phrase with by.

Solution 2:

It depends on the context

When you say, "if I'm not mistaken..." I am going to conclude you mean "assuming I am not in error." This expression is very common in the native English vernacular of the US and likely other areas as well.

When taking about identities, to be understood I would avoid using the phrase "if I'm not mistaken." Instead, I would replace words as necessary to avoid confusion. Often replacing"if" with "when" will be sufficient.

"When I'm not mistaken for Tom people don't treat me like a jerk."

The "for Tom" is an additional contextual clue that the meaning is different.

Seldom if ever will there be cause for a native speaker of American English to be confused by this expression.

Solution 3:

yes it is ambiguous. it can mean either "in error" ("if I'm not mistaken") or "wrongly taken", i.e. "I'm often mistaken for my brother.