Police have arrested two teenagers who allegedly stole an unoccupied R train last month and took it for a joyride in Brooklyn, authorities said, while transit officials look to step up security.

Both teens — ages 15 and 17 — were charged Monday with reckless endangerment, criminal mischief and trespassing, according to police. The younger teen was also charged with possession of burglary tools. Police said Monday they were still looking for four others who participated in the Jan. 25 incident.

“Breaking into and moving subway cars is dangerous, illegal, and will not be tolerated,” NYC Transit President Demetrius Crichlow said in a statement. “We thank the NYPD for capturing these perpetrators who not only put their own lives at risk but also riders and transit workers.”

Crichlow said that the transit agency would step up its security at “key transit locations” and is now actively exploring new technologies — like biometric verification — to prevent access and control of the operator’s cab.

Investigators began searching for the suspects more than a week ago, when the group allegedly broke into the train, disabled its black box and operated it for hours.

Surveillance video of the incident released by the NYPD shows the suspects entering the train and strolling up and down a train car before they operated the vehicle.

Police said the group also damaged glass panels on the train’s camera by putting markings on them.

A spokesperson for NYC Transit added that the agency is working on incorporating an alarm system as well as reviewing circuit capacity to include audible sirens and an enhanced lighted indicator for unexpected movement.

The city is also developing a procedure to mount devices at the entrances and exits of train storage areas that could automatically trip the emergency brake of each car that passes over them, the spokesperson said.