A typical Thomas the Tank Engine story is a little morality play about hubris. The stories take place on the fictional Island of Sodor, where train cars with faces and personalities go about their work.

Almost inevitably, one of the trains tries to run too fast or pull too many boxcars and ends up in a big mess. By the end of the story, though, he comes to understand what he has done wrong. As the last line of ''A Big Day for Thomas'' puts it, ''Thomas had already learned not to make the same mistake again.''

An English clergyman named Wilbert Awdry invented the talking trains in the 1940s, while trying to entertain his son Christopher, who was laid up with the measles. The first book was published in 1945, and a new one followed every year until 1972, when Mr. Awdry retired. In the 1980s, the Thomas stories became a hit television series. These days, millions of little toy Thomas trains are sold every year around the world.

As you have probably heard by now, the toy trains are manufactured in China, and one of the factories that makes them has been using lead paint for the last couple of years. So last week, the United States government urged parents to confiscate 26 different kinds of Thomas toys. The manufacturer, the RC2 Corporation, asked that customers mail back the toys and promised to send lead-free replacements within six to eight weeks.

But this isn't really about replacing toy trains. It is about the realities of offshoring, and it doesn't yet have a tidy Thomas-style ending.

Over the last two decades or so, American companies have generally followed a two-pronged outsourcing strategy. First, the companies have tried to move as much of their manufacturing as possible to places where wages are just a fraction of what they are here. Second, the companies have distanced themselves from their overseas production. They usually don't own the factories and refuse to say much about them.

The current issue of The Atlantic Monthly has a fascinating cover article by James Fallows taking readers on a tour of Shenzhen, a southeastern city of eight million people (stunningly, up from just 80,000 a generation ago) that isn't far from the factories that make the Thomas trains. Many of the world's best-known companies -- like a company that Mr. Fallows describes as a ''very famous'' American retailer -- get products from Shenzhen. But he didn't get permission to connect any of the individual factories in his article with a specific brand.

''In decades of reporting on military matters, I have rarely encountered people as concerned about keeping secrets as the buyers and suppliers who meet in Shenzhen and similar cities,'' he wrote.

This secrecy brings a number of advantages. It keeps competitors from finding out tricks of the trade. It keeps consumers from discovering that their $100 brand-name shirt comes from the same assembly line as a $40 generic version. And it prevents activists from criticizing a company for the working conditions in a factory where its products are made. The companies get the cost advantages of outsourcing without the publicity disadvantages.

In the days since the Thomas recall was announced, the company that owns the Thomas brand, HIT Entertainment, has stuck to this script. HIT is an English company that holds the rights to a number of popular characters, including Barney and Bob the Builder, and then licenses the toy manufacturing to companies like RC2.

Except for a small link on the Thomas Web site to RC2's recall announcement, HIT has otherwise acted as if it has nothing to do with the situation. Its executives haven't even said that they regret having been promoting toys with lead paint in them. They haven't said anything publicly.

When I suggested to the company's public relations agency, Bender/Helper Impact, that this might not be the smartest approach, the agency e-mailed me a two-sentence unsigned statement. It said that HIT appreciated the concerns of its customers and was working with RC2 on the recall, but that the recall was ''clearly RC2's responsibility.''

In effect, HIT has outsourced Thomas's image, one of its most valuable assets, to RC2. And RC2 has offered a case study of how not to deal with a crisis, which is all the more amazing when you consider that the company also makes toys for giants like Disney, Nickelodeon and Sesame Street.

When it first announced the recall, RC2 said that its customers would have to cover shipping costs to mail back the trains. It reversed that decision after parents reacted angrily, but it is still going to wait about two months to send the postage refunds. Why? ''Because finance is in another building,'' as one customer service employee on RC2's toll-free hotline told me.

Most important of all, the company hasn't yet explained how the lead got into the trains or what it's doing to avoid a repeat. Like their counterparts at HIT, the RC2 executives have stayed silent.

Battening down the hatches might very well work if this were a scandal about sweatshop conditions. Fairly or not, Americans have a limited attention span when it comes to human rights problems on the other side of the world. But the prospect of lead paint in your child's nervous system tends to focus the mind.

The fact that the executives at HIT and RC2 haven't grasped the difference shows how out of date the corporate script on outsourcing has become. In many businesses, outsourcing has simply grown too big to stay behind the curtain. What happens in Chinese factories determines how good -- how reliable and how safe -- many products are. So there is no way for executives to distance themselves from China without also distancing themselves from their own product.

The government clearly needs to play a role here by inspecting more of the items coming into this country. Perversely, the Consumer Product Safety Commission has fewer employees than it did 20 years ago when there were far fewer imports.

But there is also reason to hope that basic competition will take care of some of the safety problems now being exported from China. Adrian J. Slywotzky, the management writer and consultant, argues that smart companies are starting to realize that they are better off knowing what happens in their factories. Nike, for instance, began to get more involved with its overseas suppliers after it was criticized on human rights grounds, but as a result, the company has also figured out how to get products to market more quickly. ''There is a big upside to dealing with this problem,'' Mr. Slywotzky says.

I don't know if I am quite as optimistic as he is. But it does seem likely that consumers will eventually punish a company that ducks responsibility for the safety of its products.

There's another Thomas story, called ''Cranky Bugs,'' that comes to mind here. In it, a big crane named Cranky is mean to Thomas and his friend Percy, another little train car on the Island of Sodor. Eventually, though, Thomas and Percy manage to knock over Cranky. After that, he stops being such a bully -- because, as the story concludes, ''he knows they may bite back.''

Photo: The RC2 lead paint recall notice for Thomas & Friends toy trains.