Electrolysing water to make H2 and extracting CO2 from the environment, and then synthesizing hydrocarbons from them, is extremely energy inefficient.
Sure, theoretically, it can be done, and maybe one day it could even be done efficiently. But Tesla is making battery-electric cars that work today.
The military does not care about efficiency because they have nuclear reactors on their ships and their goal is to not to have to transport liquid fuel.