IF it suddenly dried up, like within a year, militaries would be the last thing on peoples minds, because the world would be chaos, at least compared to how we know it today.
Thankfully, it doesen't just turn off like a faucet.
The issue isn't running out of oil, it's running out of cheap oil.
The militaries would still get their fuel. It's the people that would suffer. But then again, it probably won't be a bad thing. Assuming we run out of oil slow enough, the rising cost of petroleum products will prompt R&D teams looking into alternatives to start up shop.
It's only a sudden, massive shortage that would be catastrophic, and that is fairly unrealistic.