Yes it is true although not with a torpedo
Volunteers from the Barb rigged charges on the bridge that were detonated by a train passing over it thus denying Japan's ability to move supplies in the area. The boat's battle flag was unique. In addition to the Medal of Honor ribbon at the top of the flag identifying the heroism of its captain, Commander Eugene "Lucky" Fluckey, the bottom border of the flag bore the image of a Japanese locomotive. After the war the Barb left service in the US for a future in the Italian navy as the Enrique Tazzoli. In 1973 she was sold for scrap for the paltry sum of $100.000.
Cheeers, Bill W