1

Word done by the gas on the piston (or deformable wall) is $p_{int} \Delta V$, and work done by the piston on the outside atmosphere of pressure $p_{ext}$ is $p_{ext}\Delta V$.
The difference $(p_{int} - p_{ext})\Delta V$ is the net work done by gas from both sides on the piston.