The cost of repairing or replacing any buoy or beacon which is maintained by authority of the United States Bureau of Lighthouses which may be misplaced, damaged, or destroyed by any vessel being made fast to it, is, when the cost is legally ascertained, a lien upon the vessel, and is recoverable against it and its owner.