NORRISTOWN, Pa. — When Bill Cosby arrives at the historic courthouse here on Tuesday to fight charges that he sexually assaulted a young woman 12 years ago, the key players at a pre-trial hearing may well be two men whose own rivalry has become part of the unfolding drama in Mr. Cosby’s criminal case.

One is Bruce L. Castor Jr., the former Montgomery County District Attorney, who in 2005 found “insufficient credible and admissible evidence” to bring charges against Mr. Cosby after a Temple University basketball manager said the actor drugged and sexually assaulted her at his home near here.

The other is Kevin R. Steele, the newly elected district attorney, who in December, citing new evidence, reversed that decision.

In the fall, the two men faced off in a campaign for the district attorney’s seat that grew bitter as Mr. Steele deeply criticized Mr. Castor’s handling of the case years ago.