Basically yes, but the amount of available fuel is limited by the cultivated area (which cannot be used to produce food) and the solar radiation.
Agricultural wastes (e.g. straw) can also be methanised, and methane can be polymerized to make liquid fuel. This uses some energy an is rather expensive.
In fact, the petrol was produced from biomass by bacteria and stored during millions of years. Our climatic problem results form burning nearly the whole stock within a couple of centuries.
Yes, biomass waste from agricultural products can optimally replace fuel, but its effectiveness depends on overcoming challenges related to conversion efficiency, economic feasibility, infrastructure, environmental impact, and logistics. Technological advancements and sustainable practices are key to maximizing its potential.