@layman,
layman-
Yes, quite so. If Mr. A is charged with the murder of Mr. X and Mr. A testifies that he did not murder Mr. X but Mr. B murdered Mr. X. Mr. B testifies that he did not kill Mr. X but Mr. A murdered Mr. X.
I believe the judge instructs the jury in the law and it is the responsibility of the jury to decide the facts.
The jury may convict Mr. A of murder based on its judgement of the relative credibility of the witnesses. However, the judge may think that Mr. B is guilty.