Two “unseaworthy” former Royal Navy flagships are set to be sold in a bid to cut costs.