They were abducted while returning home from school.
Kaushal Kishore Yadav and Rampunit Yadav of Khakana Higher Secondary School were freed with the help of their relatives, according to Mahottari police.
Family sources said they had to pay Rs 300,000 to secure their release.