No injuries were reported and there were no explosions, said Indiana State Police.
Officials at the Crane Naval Surface Warfare Center said the assortment of bombs, demolition charges and propellant charges in the two flatbed cars posed no danger.
"We don't view it as an explosive threat," said Army Col. Lawrence J. Sowa.
Authorities evacuated some homes in Burns City as a precaution, but many residents chose to stay. State Road 645 was closed to traffic at U.S. 231.
The four flatbed cars derailed during a switching operation a half-mile outside the Crane base, said John Bergene, a spokesman for Canadian Pacific Railway. Two of the cars tipped over, spilling eight shipping containers on the ground.
Officials don't yet know what caused the accident.
"We're investigating it right now. Human error is certainly one factor that we're looking at," said Bergene. Investigators will also look at the equipment involved and the condition of the track, he said.
Many residents of Burns City disregarded evacuation orders and stayed in town. They included William A. Strange, a 76-year-old Crane retiree, and his wife, Mary, who went to a nearby beauty parlor.
"They came to the door and said it would be better if we left, but if we left we couldn't come back. Goodness knows how long that could be," Strange said.
Carmen Schuler, 39, was staying with her mother about 10 miles south of town.
She said she looked outside about sunrise and saw two of the derailed cars along the back edge of her property. They had crushed part of her wooden fence.
"I didn't even realize until it started to break daylight,"she said. "I did hear a loud bang, but it just sounded like they were hooking. It's pretty well like a little clutter over there."
It was at least the second derailment involving hazardous cargo at or near the base. In June 1997, a tanker car containing sulfur dioxide was among four cars of a Canadian Pacific train that derailed inside the Burns City gate.
The base, about 75 miles southwest of Indianapolis, is the Navy's second-largest in the continental United States, covering 98.2 square miles of Martin, Greene and Lawrence counties. It has a civilian workforce of more than 3,200.
Operations at the base conduct research and development on weapons, alternative fuel cell technology and chemical and biological warfare detection.