TORONTO -- The judge presiding over the Toronto trial of two men accused of plotting to derail a passenger train has begun delivering what he warned was a lengthy set of instructions to the jury hearing the case.

Justice Michael Code told the 14 jurors hearing the case they have a responsibility to protect people from unjust convictions, but an equal responsibility to protect the safety and security of the community.

Raed Jaser and Chiheb Esseghaier face several terror-related charges in the alleged plot to derail a Via Rail train travelling from New York to Toronto. Not guilty pleas have been entered for both men.

Code has emphasized that the onus of proving Jaser and Esseghaier's guilt rests with the Crown.

He also says that if any reasonable doubt arises about Jaser or Esseghaier in relation to the offences they are charged with, the jury has to find them not guilty of that offence.

Code says a reasonable doubt is one "based on reason and common sense after having considered all the evidence as a whole."

"It's not enough for you to believe that Mr. Esseghaier or Mr. Jaser is probably or likely guilty. In those circumstances you must find him not guilty," he said.

"If at the end of the case, after considering all the evidence, you are sure that Mr. Esseghaier or Mr. Jaser committed a particular offence, you should find him guilty of it."

Code repeatedly reminded jurors that they must consider the evidence presented in the case "in its totality" and also cautioned the jury not to indulge in conjecture or speculation "in matters which have no evidentiary foundation."

"Your inferences should be rational," he said. "Speculation has no part in the judicial function."

The Crown has argued there is an "overwhelming" amount of evidence against both Jaser and Esseghaier, and has urged the jury to find both men guilty on all charges.

Esseghaier, who is self-represented and has refused to participate in the trial because he does not believe in the Criminal Code, told jurors through an unusual closing address that only the Qur'an should be used to judge him.

Jaser's lawyer argued that his client was never interested in carrying out terrorist activities but instead wanted to extract money from his co-accused and an undercover FBI agent who joined their alleged plot.

The court has heard hours of secretly recorded conversations between Jaser, Esseghaier and the undercover officer in which they discuss ideology and alleged terror plots -- including the alleged train derailment plan.

Jaser and Esseghaier were arrested in April 2013.