I'm not sure if this answer provides you with the universal property that you desire, but there is such a category that unifies these concepts that you are after.
Cohen, Jones and Segal introduced a concept known as the "Flow Category"Category" in the paper Morse Theory and Classifying Spaces, which associates to any manifold with a Morse Function a category whose objects are the critical points of the Morse function and whose morphisms are the gradient trajectories of some gradient-like vector field. Here is the reference:
You can get the paper on Ralph Cohen's page if you don't have university access:
Recall that Morse Theory was invented by Marston Morse to study geodesics on manifolds. Geodesics correspond precisely to critical points of the Energy functional. I imagine that any variational problem fits into this framework.
As a word of caution, understanding the space of gradient trajectories lies at the heart of Floer Theory, so if you want to understand Morse Theory on infinite dimensional spaces, prepared to get your hands dirty with some serious analysis. Comment if you want more references. Also, most of the above article is concerned with proving a very elegant result about the classifying space of this category for certain situations. It is very slick!