The forces to accelerate or decelerate the fluid in a portion of the duct are (1) the pressure upstream times the upstream cross sectional area (imposed by contact with the upstream fluid), and acting in the downstream direction, (2) the pressure downstream times the downstream cross sectional area (imposed by contact with the downstream fluid), and acting in the upstream direction and (3) the surface pressure forces integrated vectorially over the curved wall surfaces of the duct, and acting either in the upstream- or the downstream direction (depending on the orientation of the surface).
The general equation describing flow of an inviscid fluid is a partial differential equation known as the Euler equation. The Bernoulli equation and the macroscopic momentum balance equation are integrated versions of the Euler equation, which describe certain features of an inviscid flow for macroscopic systems. Neither contains all the information regarding the details of the fluid flow contained in the Euler equation, but both are very useful in applications. The Bernoulli equation is a macroscopic energy balance on the flow, and the macroscopic momentum balance is a force balance which enables you to determine the overall forces responsible for acceleration and deceleration of the fluid (usually in a duct), including the forces exerted by the boundaries.