 Greenbrier Companies Inc. reported Wednesday that it swung to a fiscal second-quarter profit and revenue that more than doubled, as the war in Ukraine provided a boost to the maker of railroad freight cars and equipment. 