We present a local-realistic description of both wave-particle duality and Bohmian trajectories. Our approach is relativistic and based on Hamilton's principle of classical mechanics, but departs from its standard setting in two respects. First, we address an ensemble of extremal curves, the so-called Mayer field, instead of focusing on a single extremal curve. Second, we assume that there is a scale, below which we can only probabilistically assess which extremal curve in the ensemble is actually realized. The continuity equation ruling the conservation of probability represents a subsidiary condition for Hamilton's principle. As a consequence, the ensemble of extremals acquires a dynamics that is ruled by Maxwell equations. These equations are thus shown to also rule some nonelectromagnetic phenomena. While particles follow well-defined trajectories, the field of extremals can display wave behavior.