A Queens judge ruled yesterday that subway employees do not have to do anything but pick up their phones if they see a crime — as he threw out a suit against the MTA and two workers who did nothing more to stop a rape.

A conductor saw the rape from the window on his train, and a station agent in the booth witnessed a screaming woman being dragged down a staircase inside the desolate 21st Street station of the G line. But neither one left the safety of their assigned posts to help her. Instead, conductor Harmodio Cruz and agent John Koort called the command center to summon cops.

Justice Kevin Kerrigan ruled the two workers had taken “prompt and decisive action in obtaining police help,” according to the decision handed down in Queens Supreme Court. The help came far too late for the victim, who was raped on the platform.

Her lawyer, Marc Albert, called Kerrigan’s decision “offensive,” saying it gives “blanket immunity” for transit workers to ignore straphangers in peril. “Simply pressing the button is enough,” lamented Albert. “God forbid citizens are put in a position where municipal workers are not required to act and it leads to harm — they are left out in the cold.”

The victim, an artist, was inside a Queens-bound G train at 2:15 a.m. on June 7, 2005, when the only other person in the car began to touch her feet. She jumped away from him, but the commotion caused her to miss her stop at Greenpoint Avenue.

She got off at the next stop, 21st Street in Long Island City, but as she waited for a Brooklyn-bound train, the same sicko — who had followed her off the train — began licking her feet.

She ran up a staircase toward the platform, but the psycho grabbed her in a bear hug and hauled her down the steps.

A station agent saw the commotion, hit a panic button in the booth and called the command center for cops. The conductor of a Brooklyn-bound train saw the scuffle, heard the woman screaming and notified the train operator, who in turn also called the command center.

Albert argued that the workers could have done more without physically confronting the attacker — the conductor could have stopped the train, he said, and the station agent could have called police directly. But Kerrigan wrote that it was “pure speculation” that added efforts would have helped the victim.

Cops arrived in about 10 minutes, but the attacker escaped up a different staircase. He has never been caught, police said.

New York City Transit officials declined to comment.

william.gorta@nypost.com