Yes, but why wasn't that invented until fairly recently? The Greeks could probably have accomplished one.
The primitive Steam Engine is at least as old as Heron of Alexandria, who used them as part of his designs (mostly as curiosities or amusing "gadgets" of their day).
In my opinion, the reasons for the advancement of technology are likely the result of a combination of factors. Some of it is dumb luck. You not only have to invent the steam engine, you need to realize their potential to do productive work. To some extent that requires you to have access to plentiful supplies of fuel (to keep them running) but also an understanding of the sorts of tasks that might be aided by such an engine. Newcomen's steam engine (and Watt's later on) were used as water pumps, particularly in mines. You needed to be aware of the problem of water collecting in mines for to begin the process of figuring out how to correct that problem.
I suspect (as a BS off the top of my head hypothesis) that the real impetus for the industrial revolution was a combination of (i) social structures that allowed for the upward mobility of a broad range of the population (something ancient China lacked), (ii) the printing press and (iii) feedback.
The printing press is what allowed knowledge to start spreading quickly, on those rare occasions that technological innovations were discovered, it was the vastly more efficient spread of information disseminated new technological, scientific and philosophical principles more widely, without having to transport the contraptions or experts themselves. There was a general increase in the level of education in Europe as a result, which meant there were more people with the technical knowledge needed to "invent" new technology. The more people, the more likely that genuine technological leaps will come about.
As technology started to build up (and spread, thanks again to the printing press), economic productivity increased as did national wealth. Higher wealth levels gave the educated more capital and free time which they could dedicate to new (and bigger) scientific and technological research. Plus, the rapid increase in technology allowed for a great degree of interaction. In order to invent the steam powered water pump, you need to see both the steam engine and the water pump and combine and refine them. The more technology there is, the more interactions there are to explore.
The odd thing is that printing press may have only come because Gutenberg failed in a venture to sell religious trinkets to pilgrims traveling to Aachen. Gutenberg evidently got the
year wrong, and so there were no pilgrims. Under threat to repay the money he borrowed for the venture or else, he dreamt up the printing press. Or so the legend says. If true, that is a pretty random reason for so critical an advance in technology.