Most of the DC trails close at sunset, but they are kept open for commuters.
The CCT goes thru nice neighborhoods, but since it is wooded and separated it feels very far from the city.
The Mount Vernon and W&OD has occasionally had an attack reported. The lower end of the W&OD goes thru a rough area, but it's adjacent to a busy street.
If you want some good night riding, go down to the Mall and Potomac Park. Wilson Blvd in Arlington is also pretty lively. Also Old Town Alexandria.