Essex battle with ball in second innings but face daunting fourth-innings task