1. I saw a boy in the car.

2. When I saw a boy, I was in the car.
3. I saw a boy who was in the car. At that time I was near the car.
[Does #1 mean either #2 or #3 according to the context? Which one is a common explanation for Sentence 1?]

1 and 3 mean the same thing. 1 is the more common expression. 3 is wordy and rather awkward.

2 does not mean what the others do.

1 means that, as I was standing or walking by/near the car, I saw a boy inside it.