Both of those religions were pretty enormous at one point - why did no "substitute" for pigs ever get into the short list for livestock? It just seems like with so many people refusing to eat pork, ranchers would've just started raising some other animal instead - if for no other reason, it would be more efficient. You can raise 3 animals that everyone eats, or 2 animals everyone can eat and 1 animal only a few people eat.
I'm not sure I understand your question. Do you mean why did the rise of these religions not lead to their supplanting on the "livestock chain" in regions where they are not the majority religion? e.g. "Why did the advent of Islam not lead to the Chinese giving up pork?"
Or do you mean "Why did the rise of these religions not lead to the advent of 'substitutes' for pigs in the regions where those religions arose? e.g. the Greater Middle East?"
I think I can more easily answer the second one, although more for Islam than for Judaism:
(1.) In the case of Arabia I've looked into this before and as far as I can tell pigs were not a factor in animal husbandry in pre-Islamic Arabia. Speaking very generally, agriculture in the Arabian peninsula consisted of: oasis palm groves, transhumance/semi-nomadism (that is, the moving of livestock from highlands to lowlands according to the season), and full nomadism (that is, herding livestock from place to place year round looking for grazing). Only in the mountains of southern Arabia in modern Yemen or Oman (which benefit from regular monsoon rains and fogs which arrive in what for the rest of Arabia is the hottest part of the year) did cisterns, qanats, falajs, dams, and step/terrace farming allow for regular farming of crops.
Now, I'm not an agricultural expert, but as far as I'm aware none of that is conducive to raising pigs, who can't easily be herded from place to place like goats or camels.
If pigs were kept in pre-Islamic Yemen or Oman (and I'm sure someone, somewhere tried to; these are very old civilizations we're talking about here) it doesn't warrant a mention in any book I've come across on the subject, books that otherwise discuss agriculture quite a lot.
(2.) That raises the issue of where in the broader Middle East pigs were found and why.
First there are wild pigs. But we can leave those aside as your question is about the actual raising of pigs.
Here I'm going to jump from the very ancient to the very modern. Pigs in the contemporary Middle East are, if anything, an urban phenomenon.
The British quiz show QI did an episode a few years ago where they claimed that aside from hunting truffles, pigs are the only animal raised by humans whose only uses arise when it's dead.
That isn't the case at all. Pigs are fantastic devourers of garbage. The phrase "he eats like a pig" has real meaning. Pigs will eat just about anything (which, far more than theories about trichinosis, strikes me as the most likely reason why pork is non-kosher in the first place.)
In Egypt, where about 10% of the population is Christian, Cairo's garbage collection is traditionally carried out by a Coptic Christian community known as the Zabbaleen (literally, "garbage people"). They make their living from fees for collection, recycling/scrapping (at one time Cairo claimed to have one of the highest recycling rates in the world), and feeding organic waste to their pigs which they can of course then eat themselves or sell to other Christians.
This use of pigs as waste disposal is an ancient one.
This mention of Christians also brings me to point
(3.) Not all of the Middle East converted to Islam, not by a long shot.
Unfortunately the past century of wars, persecutions, and various forms of Islamism have done much to change that, but as recently as the 1920s there was barely a country in the greater Middle East that was not at least 10%. That we take it for granted today that a country like Turkey is 99% Muslim the real historical aberration.
Urban centers, which, as I've said, we have reason to believe werea focus of pig farming, were especially diverse.
As a general rule, after the initial conquests of Islam, it wasn't for 200 years that the regions under Islamic rule became majority Muslim, whether by conversion or migration. Not until 20th century migration, persecution, genocide did almost any territory of the Middle East become virtually solely Muslim.
(4.) This one is the least inter-related of the other three, and I'm not entirely sure it's what you had in mind, but the Middle East does have plenty of livestock that is higher status than pigs. For the reasons I've laid out, it wasn't a "replacement" per se because in much of the region pigs weren't all that important to begin with. But on a relative scale in the region pigs are hardly consumed at all while camel meat is still common (you can go into a Carrefour supermarket in Dubai and get pre-made camel burgers). Even goat, which is a perfectly normal animal to eat, for some reason has a negative connotation in much the west that doesn't exist in the wider Middle East (or, for that matter, in Africa, or other parts of Asia, etc.)
Lastly, as a proud pig bacon eater myself, it's worth noting that even devout Muslims have come around to the notion that salted, smoked strips of fatty swine flesh taste great, even if they can't eat them themselves. That's why substitute bacon products like turkey bacon and beef bacon are ubiquitous in the Middle East. As are cured meats in general like Bastirma.