Soldiers patrolling the town of Gamboru opened fire after the two girls, strapped with explosives, refused to remove the vests in the early hours of the morning. A third girl was arrested.
"Three teenage suicide bombers were found by soldiers and two of them were killed while the third was arrested with her explosive belt," said Umar Kachalla, a civilian militiaman in the town close to the Cameroon border.
"Two of the girls who were walking together were asked to remove their vests but they refused and were shot dead by troops," he added.
Soldiers spotted the third girl after she abandoned her explosive vest in a nearby empty building, said another militiaman Shehu Mada.
The attempted bombing comes as Nigeria has launched a major offensive against Boko Haram following an escalation in attacks by the jihadist group over the festive season.
Last Wednesday, 14 worshippers were killed when a suicide bomber attacked a mosque in Gamboru during morning prayers, according to vigilantes and residents.
Boko Haram had previously controlled the town, a trading hub, for over a year after seizing it in August 2014, along with the neighbouring Ngala.
Nigerian troops retook both towns in September 2015 with the help of Chadian forces.
Despite the recapture of the area, Boko Haram fighters continue to launch offensives, ambushing troops and vehicles, and attacking farmers and loggers.
Last week, Boko Haram leader Abubakar Shekau released a video message claiming a series of attacks in the northeast, including those in Gamboru.
Boko Haram's eight-year insurgency against the government of Nigeria has spilled into neighbouring Niger, Chad and Cameroon, killing around 20 000 people and displacing more than 2.6 million.