Geodesics with prescribed energy on static Lorentzian manifolds with convex boundary