The answer to this is strictly a matter of opinion, I think, and yours might differ considerably from mine. But assuming that a country has a choice of only one or the other and that the country is a democracy, I would always vote for free higher education in the belief that free higher education would lead to a situation in which a well-funded military was not necessary.
First, in today's world and in the future, a successful military is a function of technology, not manpower, and I believe that manpower is the most costly portion of the military budget. Thus, even a not so well-funded military is likely to be at least adequate.
Second, and concomitantly, funding higher education is likely to lead to new and better technological development that a military can avail itself of to keep down costs. One of the biggest problems the United States faces is unequal access to higher education. We are not properly developing the next generation of scientists and engineers, for instance, because we are not helping people to develop their inherent intelligences. Our next potential Einstein might very well be working at McDonald's because he or she could not afford to go to college.
Third, the wars of the world now, and increasingly in the future, will be waged economically and psychologically, not with guns and missiles. If everyone can receive a free higher education, that is its own form of national defense. Educated people can get to Mars and explore the sea for its resources. People who are educated can compete economically and understand the psychological dynamics of a different kind of warfare.
Finally, and perhaps most importantly, a well-educated populace is far more likely to see the benefits of a peaceful world, the gains to be had with diplomacy and cooperation, the foolishness of intervention in other countries, and the dreadful costs of war. Such a populace would choose its leaders more wisely, with critical thinking, rather than with knee-jerk responses to fear-mongering political advertisements.
There is no doubt in my mind that free higher education is more important to a democracy than a well-funded military, an entity that has a vested interest in war. Education has a vested interest that serves everyone so much better.