A five-hour pursuit in Sydney's south-west has ended with police cornering three teenagers in suburban backyards.