Egyptian officials say Somali pirates have released an Egyptian cargo ship and its 28-member crew after more than two months in captivity .