The tourist had been held hostage at gunpoint in a secluded underground room close to a pilgrimage site, according to a preliminary investigation.
“When her health condition deteriorated due to repeated rape and poor living conditions, she was brought to Gaya (district headquarters) for medical treatment on December 20,” a police officer who is part of the investigation told AFP on condition of anonymity.
But she managed to escape and reached Varanasi where she met some Japanese tourists who helped her contact the Japanese consulate in the nearby city of Kolkata, the officer added.
Sajid Khan, 32, and his 25-year-old brother Jawed Khan, both tourist guides, were arrested in the case on Friday, police deputy superintendent Alok Kumar Singh said.
“We have arrested the duo for confining and raping the Japanese student,” Singh told AFP by telephone from Bodh Gaya.
The Bodh Gaya complex, 110 kilometres (68 miles) south of Bihar state capital Patna, is home to one of the earliest Buddhist temples still standing in India and attracts visitors from all over the world.
The Japanese woman, a university student, had come to Gaya from Kolkata where she had checked into a hotel in November.
India has faced intense scrutiny over its efforts to curb violence against women following the fatal gang rape of a medical student in New Delhi in 2012 which sparked global outcry.
Since then, several attacks on foreign women have also been reported, leading to a dip in tourist numbers to the country.
Last January, a 51-year-old Danish tourist was robbed and gang raped at knife-point in Delhi.
In 2013, a Swiss cyclist holidaying in central Indian state of Madhya Pradesh was robbed and gang raped by five men, all of whom were later sentenced to life terms.