I'm familiar with the layout near the tracks through Quantico and have been in the area on occasion, and I'm not aware of any photo restrictions near the tracks. Usually military bases get touchy about pictures taken on an airfield's flight line (except during an air show, and then everyone's taking photos of everything -- go figure) but there shouldn't be any problem with taking pictures from a passing train.
What jackintosh11 encountered may not have been company policy, but rather an individual conductor's policy, which may have gone off the deep end.
Sometimes this sort of thing goes beyond the absurd. For example, I recall a volunteer (now long gone, thankfully) at the Walkersville Southern Railroad in Maryland who was bothering visitors during an operating weekend. A number of cars were awaiting or undergoing restoration in the small yard across the street from the station and some passengers, after riding the train, wanted to take some pictures. He shooed them away, telling them it was illegal to take pictures of railroad equipment in Maryland. (In case you're wondering, that's just not true, especially as the WS. Knowing the individual, it was much more likely he was simply enjoying the opportunity to throw his weight around.) Around this time the MTA's cops were routinely harassing rail buff photographers and threatening them with arrest, which was certainly a lot safer for the MTA cops than confronting actual criminals in and around the badlands of Baltimore. Later it came out that during annual training classes, MTA cops were being told that rail photography was perfectly legal, but they continued to harass rail photographers anyway.