The teenager – who can’t be named for legal reasons – is also accused of intentionally engaging in sexual activity in the presence of the youngster and his brother while the siblings were both under the age of 13.
He is charged with two counts of inducing the brothers, then aged ten and 12, to watch pornographic images and then performing a sex act on himself at an address in Falkirk.
He is also accused of raping the ten-year-old twice.
The younger of the two brothers, now aged 12, gave evidence via a CCTV link at the High Court in Livingston yesterday.
He told how the accused had invited him and his brother to his home to play X-Box games.
When it was his elder brother’s turn to play, he said the accused invited him upstairs to his bedroom to “look for his wallet”.
While he lay face-down on the bed searching under cushions for the missing item, the boy said the accused pulled down his trousers and pants and raped him.
The accused, who now lives in Stepps, North Lanarkshire, denies all the charges against him.
The trial, before judge Lord Matthews, continues.