When there’s a problem, we can usually count on Congress to react by a) throwing money at it and b) regulating it. Case in point: homeland security.

Two recent overseas terrorist attacks -- including a bombing on the India-Pakistan rail line -- have sent Congress into apoplexy. Lawmakers plan to have a bill that would dramatically step up rail security on the Senate floor very soon.

However well-intentioned, though, this knee-jerk approach to homeland security will not serve Americans very well. Focusing myopically on specific threats (such as a potential terrorist attack on a train) is a grave mistake. More than 140,000 miles of rail track are in the United States, along with several million rail and passenger cars. Trying to protect everything would be extremely difficult and expensive.

Terrorists realize they could do the most damage by attacking cars containing lethal hazardous materials or bombing crowded commuter cars or stations. Yet even if money was no object and these vulnerabilities could be completely eliminated, a determined terrorist could still attack the U.S. rail system.

In fact, that’s the lesson of the recent train bombing in Asia. The India-Pakistan line is one of the most closely guarded in the world, yet it was attacked anyway. If America spends billions more on rail security and still suffers an attack, most people would be greatly unsettled. They’d end up fixating on why expensive security failed and fail to notice that more tempting targets have been successfully protected.

It’s impossible to “harden” everything enough to deter terrorists. And hardening one target while shortchanging everything else won’t stop terrorists. That’s the irrefutable finding of “Breaching the Fortress Wall: Understanding Terrorist Efforts to Overcome Defensive Technologies,” a recent study by the RAND Cooperation, a non-profit, non-partisan research institution.

According to lead author Brian Jackson, “Terrorist organizations keep changing their strategies in order to remain effective, and we have to design our defense capabilities to adapt. If we don’t, we risk spending our resources building the equivalent of a fortress wall that won’t actually provide much protection once terrorists have found a way over, under, through or around it.”

Throwing more money and rules at rail security is a good example of a bad idea, of buying into the notion that building a “fortress wall” can make us safer.

Much of the misplaced emphasis on beefing up rail security further is justified only if we ignore reality. While trains haul some 1.2 million containers of hazardous material, less than 10 percent carry chemicals that could immediately endanger large numbers of people under any conditions.

True, terrorists might launch a terrorist attacks that could put thousands at risk. For example, a catastrophic rupture of a chlorine container (less than 1 percent of total cargo) could sicken and kill thousands. For that to occur, however, conditions would have to be perfect: the car stationary, an ideal temperature and wind to spread the gas, no alerts or evacuation after the incident, the terrorist knowing exactly when and where to attack, and breaching the container with exactly the right amount of explosives to ensure the quick release of the contents without the gas being consumed in the explosion.

In fact, that was a lesson recently learned in Iraq. Terrorists blew up a chlorine tanker, but the results were far less destructive than the average car bomb. It wasn’t a good return on their investment.

Even if terrorists did attack a train, hazardous-material teams and emergency responders are trained to deal with such incidents. In fact, most emergency professionals argue extremely hazardous material is far safer when transported by train than by truck. Train accidents are less common and usually easier to isolate and manage during an incident.

Congressional action might make sense if Washington had done nothing. But the government has acted. The Department of Homeland Security has taken many steps to improve rail security. It’s issued new regulations to freight carriers, provided homeland security grants for training, conducted risk assessments, and led planning exercises and inspections. In addition, DHS has developed and trained experts for deployment to high-risk areas when the threat warrants additional security. These measures address the most practical, common-sense initiatives that can be employed to reduce risks.

The best way to prevent a terrorist attack is to stop terrorists before they can launch one. That requires emphasizing good counterterrorism and intelligence programs, and that is where the federal government should focus its effort.

Government and the private sector should work together to take reasonable precautions that enhance the public’s safety and security -- and that’s being done. Meanwhile, Congress should focus less on doing more, and more on making sure that ongoing security programs are on track.

James Jay Carafano is senior research fellow for foreign policy studies at The Heritage Foundation.

James Jay Carafano is vice president of foreign and defense policy studies  The Heritage Foundation. Follow him on Twitter @JJCarafano.