Stochastic inflationary dynamics beyond slow-roll and consequences for primordial black hole formation