Why didn't the British army capture or at least scatter the Continental Congress?
They tried and Congress moved to York, PA. Once the British left, they came back. The effort drew away forces from the Saratoga campaign resulting in a strategic defeat elsewhere. And we can look at the Philadelphia Campaign as a microcosm of why the British army lost.
The situation in 1777
American armies in the field able to move freely meant the British army was already stretched thin garrisoning what they held. The British had resorted to hiring German mercenaries pushing more colonists over the edge. The Americans had besieged and recaptured Boston expelling the British from New England. The British responded by taking New York City. Meanwhile, an ill-conceived America invasion of Canada left the Americans in a fighting retreat in upstate New York.
Two plans
The British hatched a plan to cut off the rebellious New England from the rest of the colonies by land and blockade them by sea. General Burgoyne was to take his army from Quebec and attack south down the Hudson River. Meanwhile, General Howe was to attack from New York City north to meet Burgoyne and trap the retreating American army of Gates and Schuyler. With the American army destroyed and the Hudson River secure the British would have an easily supplied line of defense between New England and the rest of the colonies.
Meanwhile, Howe hatched a plan to use his army in New York City to attack the American capital at Philadelphia. By European thinking, the capital city is vital to the war effort as an administrative and supply hub. Capture the capital and the war is over. This might also force Washington's army, hovering in New Jersey, to stand and fight. Howe was supposed to capture Philadelphia while ensuring that he remained able to support Burgoyne's attack from the north.
Win the battle, lose the war
And had Howe taken an overland route through New Jersey he may have been able to do both. Instead, to the bafflement of even Washington, he chose an amphibious invasion via Chesapeake Bay to the south leaving him well out of position to support Burgoyne. He left General Sir Henry Clinton in charge of the remaining garrison at New York City.
After defeating Washington at Brandywine on Sept 26th he captured Philadelphia unopposed. But it didn't play out as he expected. The decentralized nature of the Americans as a collection of states, and their poor transportation system relative to Europe, meant Philadelphia wasn't critical to the war effort, and arguably neither was Congress. Congress fled the city and re-established itself 100 miles away at York and continued with their business. While Howe had defeated Washington, he was unable to pursue and Washington slipped away again.
Burgoyne goes deeper into the noose
Meanwhile, in July Burgoyne fought his way south past the substantial defenses at Ticonderoga and is now deep in enemy territory. Rather than disperse his army to maintain a supply line to the north, Burgoyne cut his supply line to keep his army concentrated. But rebel activity left him unable to forage, rough terrain slowed his advance, and after a series of defeats his native guides had left. In August Burgoyne had learned that Howe was leaving for Philadelphia putting the southern portion of the plan in doubt, but he pushed on anyway. In September he realized his army needed winter quarters. He could retreat to Ticonderoga or advance capture Albany. He decided to advance.
Meanwhile, American reinforcements had been pouring into the area. On Sept 18th, about 30 miles north of Albany, Burgoyne encountered an entrenched American army under Gates and Schuyler blocking his way at Saratoga. Burgoyne's army, exhausted and short on supply, attacked on the 19th but could not break the line. Further attacks were called off when Burgoyne received a message from General Clinton offering to march north from New York City. Burgoyne agrees and decides to wait to hear from Clinton.
Clinton doesn't save the day
Clinton did not wait for a reply and began an attack north up the Hudson. On October 6th he took two vital forts blocking his path, but it would be another week before his path forward was clear and he begins advancing towards Burgoyne again.
Burgoyne was aware of none of this. On the day after Clinton's victory, with his army on short rations, Burgoyne attacked the Americans and failed. Outnumbered 3-to-1, he withdrew and was surrounded.
On October 17th, Clinton receives a message from Howe requesting reinforcements. Being unable to relieve Burgoyne, reinforce Howe, and defend New York City, Clinton abandons his gains and withdraws to New York City. That same day, still unaware of Clinton's withdrawal, Burgoyne surrenders.
Conclusion
Howe's campaign was tactical success in that he defeated Washington and captured Philadelphia. However, none of Howe's strategic objectives were met. Washington and Congress slipped away. The rebellion fought on largely unhampered.
As a direct result of Howe's attack on Philadelphia a British army surrendered. The threat of isolating New England was gone. Worse for the British, the American victory at Saratoga helped convince the French to enter an alliance with the Americans. Later the Dutch and Spanish would join in. Now Britain faced a global war.
Howe resigned. The newly arrived French fleet threatened New York City. The British withdrew from Philadelphia to defend New York City rendering the whole operation pointless.
The British army had outmaneuvered itself.