But just one day after his filing in the Islamabad High Court, the battle came directly to him.
On Wednesday night, as he returned from a family funeral to his home in the garrison city of Rawalpindi, three vehicles surrounded the taxi in which he was traveling and pushed it off the road, he said.
Six unidentified men leapt out and attacked Raheem, raining blows on his head and upper torso.
"I resisted, so they attacked me with punches and sticks," he said during an interview at a nearby hospital, where he was treated for cuts to the nose and head. "They said they were teaching me a lesson for what I was doing."
What Raheem, a 57-year-old retired colonel, had been doing was challenging the validity of a three-year extension of service for Gen. Ashfaq Parvez Kayani in 2010. Kayani, the army chief, turned 60 this year, which Raheem argues is the age limit for his post, thus rendering the remainder of his term extension invalid.
Raheem believes the beating, which occurred just 200 yards from the military's general headquarters, was a clear attempt to force him to back off.
"No one except the army chief and his military intelligence chief can be behind this attack," he said.
The army spokesman was not available for comment, but another military official, speaking on the condition of anonymity in order to discuss the delicate issue, described Raheem's account as "baseless."
"No security official was involved in beating up of Inam ur Raheem," he said.
The investigation into the assault is now in police hands. But there is little doubt that Raheem had entered perilous waters - particularly at a time when the military leadership faces an array of legal actions that challenge several pillars of the army's longstanding grip on power in Pakistan.
Nine serving or retired generals are currently in the dock in either military or civilian courts, or under investigation by the government's anti-corruption body, the National Accountability Bureau. Last month, at the conclusion of an investigation into election rigging dating to 1990, the Supreme Court ordered the government to start criminal proceedings against Gen. Mirza Aslam Beg, a former army chief, and Lt. Gen. Asad Durrani, a former head of the Inter-Services Intelligence Directorate, or ISI.
Another former ISI chief, Lt. Gen. Javed Ashraf Qazi, who served as the railways minister under military ruler Pervez Musharraf, faces investigation for his part in a contentious deal in which land ceded to the railways was converted into a high-class country club in the eastern city of Lahore.
Meanwhile, the Supreme Court has applied stringent pressure on the ISI and its sister agency, Military Intelligence, to answer for their activities in the western province of Baluchistan. Human rights groups say that nationalist rebels there are regularly detained by intelligence operatives, tortured and sometimes summarily executed.
The Pakistani media, which have long handled the military with kid gloves, have seized on the recent cases with a newfound aggressiveness, adding to the public perception that the military has been put on the defensive like never before.
Yet for all the public humiliations, few believe the military's actual grip on power, or the influence it can wield against President Asif Ali Zardari's civilian government, has waned much. And the generals, while accepting some of the criticism, have also shot back, appearing to signal that enough is enough.
In the most notable case, Kayani issued a rare public statement this month in which he made a veiled but hard-hitting criticism of the judiciary and the media. The statement has been the subject of speculation in newspaper editorial pages ever since.
Senior generals insist that, in a country besieged by fractious politics and myriad violent conflicts, the unified and disciplined army is the glue that holds it all together. They are angered that their blood sacrifice against the Taliban in the northwest, and against nationalists in Baluchistan - a conflict they insist is being primed by Pakistan's archenemy, India - has been overshadowed by human rights concerns.
Some analysts worry that the sudden surge of judicial and media pressure against the military, which was already bristling after the humiliation of the U.S. commando raid that killed Osama bin Laden last year, could be moving dangerously fast. Beg, the former army chief, has gone so far as to warn that the court's activism risks setting off a coup.
Few believe that is likely, at least in the short term. But the bubbling judicial confrontation has certainly injected an unpredictable element into the country's power dynamics as it moves toward elections, to take place within the next seven months.
Leading the charge from the judiciary's side is the independent-minded chief justice, Iftikhar Muhammad Chaudhry, whose spirited court proceedings are supported by the rowdy and loose coalition of Pakistani lawyers whose street protests in 2007 ultimately helped push Musharraf from power. Now they have the army in their sights. On Wednesday, lawyers of the Rawalpindi District Bar passed a resolution against what they termed the army chief's interference in politics.
"The army, as an institution, has not only failed to hold its corrupt officers accountable but is supporting them," stated the resolution, according to local news media reports.
Among their number is Raheem, the retired military lawyer and a religious-minded man with a history of challenging the military. In 2007, Raheem sought the release of detainees being held in intelligence custody. This year, he defended a brigadier who was later court-martialed for spreading Islamist propaganda inside the military.
He says he believes that he was attacked Wednesday by operatives from military intelligence because, six months ago, the head of that organization, Maj. Gen. Naushad Kayani, personally warned him to abandon his legal activism.
"Give up all these cases. Anything can happen to you," Raheem recounted the general as telling him.
Now his petition against Ashfaq Parvez Kayani is expected to be heard by the Islamabad High Court next week. Raheem says he intends to press ahead - after being released from the hospital, he went immediately to a police station to file a complaint that named the army chief and military intelligence chief, whom he accused in writing of mounting an assassination attempt against him.
By Thursday afternoon, the police had not taken the case up. But Raheem said he was undeterred.
"There is no question of giving up," he said.
(Salman Masood reported from Rawalpindi, Pakistan, and Declan Walsh from Islamabad)