Internal and external pressure during a gas expansion
If the frictionless massless piston is not moving, then internal and external pressures must be equal.  If the piston has mass, the internal pressure must be greater when it is stationary, to support the weight.  If there is static friction, all bets are off.

Suppose the piston were a right cone rather than a right cylinder.  Would the excess surface area change the outcome, all other things being equal?