Yes, this is very similar to the plot for the video game Horizon Zero Dawn, but I believe it’s based in some real science. Smaller war machines (like say drones) could be made to use solar power for energy. But most large machines like tanks would need more than that.
Would it be possible to use biological processes and enzymes to create a machine that could feed off bio mass like plants, animals or humans to sustain it’s energy? If so, it’s only a matter of time before someone tries this right? Have people been trying this already?