Ridgefield recovers from three-run hole, beats Staples