LOS ANGELES — Aiming to stay ahead of an evolving threat against transit systems worldwide, officials in Los Angeles are testing out airport-style body scanners that screen subway passengers for firearms and explosives.

As commuters raced to get on their trains Wednesday, the Los Angeles County Metropolitan Transportation Authority launched a two-day pilot program. But officials quickly experienced a hiccup when a scanner being demonstrated Wednesday morning at Union Station malfunctioned before passengers could be put through the machine.

Metro is conducting the pilot program to evaluate the accuracy and capacity of the portable machines amid the hustle and bustle underground and determine if the scanners could become permanent fixtures in the Los Angeles transit system.

The machines use sensors to scan a person as they walk through, searching for firearms and explosive compounds, said Dave Sotero, a Metro spokesman. Passengers don’t need to unload laptops or take off their jackets or shoes as the radio waves scan them to detect anomalies.

“It is specifically designed to test for mass-casualty threats,” Sotero said. “The technology enables the system to locate on the body where there is a potential threat, and it appears on a video screen.”

Metro is conducting the pilot program to evaluate the accuracy and capacity of the portable machines and determine if the scanners could become permanent fixtures in the Los Angeles transit system.

Each machine is designed to scan about 600 people per hour, Sotero said. About 150,000 passengers ride on Metro’s Red Line daily, he said.

Similar to airport checkpoints, when someone passes through the scanner, they are held for a few seconds while law enforcement officers watch a monitor that shows the location of any anomalies the body. Large signs advised passengers that the screening is voluntary.

The scanners sell for about $60,000 each.