Both sentences are correct and the same in meaning, but sentence B is far more common and sounds natural.
For some reason, some Japanese verbs intrinsically have passive meanings, and they are used more commonly than the transitive verb + ~れる/られる
version.
See the following question for the list of such verbs.
This question is also related: ところを 見つかる, this was in a highly reputable dictionaryところを 見つかる, this was in a highly reputable dictionary