In both cases, Palestinians argued that the wall would be built on private land and separate them from their "centre of life" in Jerusalem.
In one of the cases, the barrier would be built on a cemetery still in use by one of the villages, according to court documents.
Last week, the Supreme Court ordered Israel to reroute a five-km section of the barrier near the Palestinian town of Qalqiliya because of hardships it imposes on Palestinians.
The court ruled in favour of the government, which argued that security needs outweighed humanitarian concerns. The government said that residents could still enter the city through passages near their neighbourhoods.
The cases were filed separately by residents of A-Sheikh and Kfar Anata, a town on the northern outskirts of Jerusalem.
Daniela Yanai, a lawyer at Ir Amim, an Israeli advocacy group that deals with Jerusalem issues, said the decisions reflect Israel's goal of strengthening its hold on occupied east Jerusalem.
"On the one hand you have Israel expanding its land, but on the other hand pushing Jerusalem residents away toward the West Bank," she said.
Israel says it needs the barrier to keep Palestinian bombers out of the country. But Palestinians say the route juts into the West Bank in several places, amounting to an Israeli seizure of land.
The route around Jerusalem is especially contentious because of conflicting claims to the city. Israel wants all of Jerusalem for its capital. The Palestinians view the predominantly Arab eastern sector, which Israel captured in the 1967 war, as the capital of its state.
Israel's defence ministry said about half of the 760-km barrier along and in the West Bank has been built, and it expects to complete work in 2008, depending on the results of ongoing court challenges.
The final route of the structure has become more significant since Ehud Olmert, Israel's prime minister, said earlier this year that the barrier would be the basis for Israel's border with the West Bank.
Olmert has said he will impose a border in which Israel would keep about 10% of the West Bank if peace talks fail.