So yeah, if you are not arrested you don't have to identify yourself. But if the police show up and you are clearly committing a crime if you actively refuse to identify yourself you will get arrested and you will have to identify yourself.
In this case it's even more bizarre and out of the ordinary. The police executed a kettling maneuver but didn't even try to identify the individuals. They don't train police officers with the ACLU "how to act if you are being detained manual" dude, it's the other way around, they train them to try to dissuade you from committing property crimes by actively trying to make you not exercise your rights and identify yourself.
Being in the Capitol while it's on lockdown is enough evidence to get arrested if you can't produce a bagde or something. Letting this people walk out is completely unjustified from the usual DC Metro procedures.
1. There are laws in every U.S. state regarding what grounds the police have to detain someone. In most states, it boils down to reasonable articulable suspicion that someone has committed, is about to or is in the process of committing a crime. Suspicion alone isn't enough. The police don't need to tell you what their reasonable suspicion is during a detainment, but if the matter ends up in court, they will.
2. There are "stop and I.D." states. If you are in one of these states, you are required to identify yourself if detained. If you're not in one of these states, such as California, you are not required by law to identify yourself when detained. That being said, if you are lawfully detained and subsequently arrested you'll be jailed until you do identify yourself no matter which state you're in.
More info here. [0]
[0]: https://en.wikipedia.org/wiki/Stop_and_identify_statutes