NOTES: I am not a lawyer. I re-wrote a large portion of this answer in 2022.
The Pokemon Company would have strong legal footing to take down Showdown, if it were so inclined. Showdown uses many copyrighted works from the Pokemon franchise, and its stated purpose is to simulate gameplay from products belonging to the Pokemon Company, Nintendo, etc.
Decision-makers at the Pokemon Company would know about Showdown, and may choose to take action at any time. However, it's interesting that battle simulators in general have escaped legal troubles for multiple decades now (ever since NetBattle in the mid-2000s), while other projects including Pixelmon and Brick Bronze have been taken down. This is not a guarantee that Showdown won't have action taken against it in the future, but one could surmise that hasn't been on the agenda historically.
Why might that be? We can speculate:
The Pokemon Company, etc. may believe that Showdown does not harm its brand or harm its sales. It may even see Showdown as free marketing, or a tool for player retention. In that case, there may not be enough motivation to take it down, as much as Showdown does infringe upon the Pokemon Company's right to create a similar product with their property.
Showdown's forced removal would generate negative press. Though Nintendo is already notorious for its stance against derivative fan projects (and seems uncaring of public perception around that), Showdown would become the most memorable of all if it were to be taken down.
Removing Showdown would significantly harm the competitive scene that the Pokemon Company is cultivating, including the "official" VGC community as well as Smogon. Content creators within the scene have never hid the fact they use Showdown.
The people in charge of Showdown try hard to stay in TPC/Nintendo's good books by harshly enforcing rules like "no sex" and "follow the law" (i.e. no discussion of emulation/ROMs).
Showdown would be replaced quickly. For a start, it is an open-source project that has been forked over 2000 times. The Pokemon Company also can't erase the knowledge and research that went into creating Showdown, and the ongoing commitment to remove simulators stemming from that may be off-putting to decision-makers.
In short: it's their right to pursue action against Showdown, but it seems likely they'll continue to let it go.