The incident took place in the Sayed Karam district of southeastern Paktia province, said provincial council member Mohammad Rahman Qadery. The hostages were taken to an unknown location, he said.
"We are not sure why they have abducted civilians, but we have deployed police reinforcement to free the passengers," provincial police chief Zalmai Uryakhail told AFP.
Local elders were also involved in negotiations to free the abductees, he said.
Mujahid said they had identified eight government employees while the remaining 19 were being "investigated".
There has been an increase in kidnappings by militant groups in Afghanistan this year.
Earlier this month, Kabul was able to secure the release of 19 out of 31 mostly Shiite Afghans kidnapped by gunmen in the southern part of the country in early February in what was reported to be a prisoner swap.
The Taliban have also stepped up attacks on government and foreign targets since they announced their annual spring offensive late last month, vowing to "safeguard and protect the lives of civilians".
The attack sparked strong condemnation from Amnesty International, which said it was a "stark reminder of the Taliban's contempt for human life" and reflected "a worrying new surge in the armed group's targeting of civilians around the country".
The Afghan insurgent group justified targeting foreigners, saying people from "invading countries" do not count as civilians.
