Interesting off-topic: according to Vaclav Smil, the number of horses in the USA peaked in the 1930s. In Europe, later still. David Edgerton's book The Shock of the Old talks about horses as well, among other "outdated" technologies.
I mean, I wouldn't be surprised if someone thought that, but given the frequency with which oil was being discovered, it seems reasonable that people would have assumed it to be effectively unlimited.
Nikola Tesla spoke glowingly about how we don’t need coal, oil, or gas if we just harness the energy around us (what he meant here was quackery, unfortunately, but wind and solar accomplish very much the same thing). People understood from the beginning that coal, oil, and gas are finite.
But by the time ICE engines were getting invented, it was a done debate IIRC. Horses used to pull trains after all, the steam engine replaced horses in train-usage decades earlier (https://en.wikipedia.org/wiki/Wagonway, for the animal-based predecessor to trains)