We have no idea where his numbers came from. Did he account for anarchy? Maintenance costs?
I would think it would always be worthwhile for the Indians or somebody with lots of jungle.
If "his numbers" referred to my ballpark figures earlier, no I didn't consider anarchy or maintenance (what does anarchy have to do with it, by the way?). I also didn't consider the cost of getting Theology for HS, nor did I consider the marginal benefit of getting a few workers built quickly (if it takes 20 turns to build Hagia Sophia or build 5 workers, by choosing the workers you at least finish one worker in just 4 turns). Nor did I consider the flexibility of being able to build just a few workers, then more later as they're needed, instead of Hagia Sophia providing a big boost all at once. Nor did I consider the obsoleting of Hagia Sophia with Steam Power, or the impact of potentially running the Serfdom civic. Nor did I consider the risk of failing to get Hagia Sophia when an AI beats you to it.
That's probably not even a complete list of potentially relevant things I ignored. It was
never intended to be a precise piece of analysis, just some back-of-the-envelope math to get a sense of roughly how Hagia Sophia compares to just building workers. My figures are also badly off for Marathon because I forgot about the (relatively) cheaper units at that speed which Vicawoo pointed out. (Marathon is not a game speed I have much experience with).
Here's the thought-experiment I was running to get ballpark figures...
Consider a typical worker action: move onto a forested tile, chop the forest, build a farm. On Quick speed, that's 5 turns without Hagia Sophia, 4 with; it's 9 vs. 7 on normal, 13 vs. 9 on Epic, and 25 vs. 17 on Marathon. And the numbers will vary a fair amount depending on what exactly your workers are doing. So I just roughed it at nice round numbers of 20, 30, 40, 50%.
As far as number of workers built vs. Hagia Sophia, that's simple math. Add up bonuses to worker production and bonuses to Hagia Sophia production, and compare base hammer costs.