Two vagrants were indicted for trying to attack a cop inside a Lower East Side subway station, prosecutors said Monday.

Eliseo Alvarez, 36, and Juan Nunez, 27, didn’t appear for the brief hearing in Manhattan Criminal Court.

They were arrested last week for a caught-on-camera brawl with Officer Syed Ali on the F platform of the East Broadway station.

Ali asked a group of five drunken homeless men to leave the station Dec. 23 after a woman complained that they were harassing her.

In response, Alvarez swung at the cop while clutching a “pointed object in his closed fist,” according to the Manhattan District Attorney’s Office.

Nunez lunged at the officer but was so intoxicated he stumbled onto the tracks.

A third defendant, Leobardo Alvarado, 31, approached Ali and stood in a fighting stance, court papers allege.

Alvarado wasn’t indicted, and Judge Althea Drysdale released him from custody. He declined to comment.

All three men face misdemeanor charges of obstructing governmental administration and riot.

Alvarez faces additional raps for felony attempted assault and misdemeanor criminal possession of a weapon and menacing.

Nunez and Alvarez are due back in court Jan. 16.