Chambers sent Dale Richards and Narsingh Deonarine back to the pavilion and Ahmed accounted for Simmons, edging a wide delivery to wicketkeeper Foster.
After the morning session had been lost because of overnight rain Chaminda Vaas dismissed Narsingh Deonarine for seven and Dwayne Smith for a duck, both lbw.
They did well to go so close at the Waca after being 68-3 at the start of their run-chase, with Narsingh Deonarine making an excellent 82 in his first Test appearance for four years.