Dozens of Muslim militants surrendered and freed 42 hostages they had seized six days earlier in a failed bid to overthrow the government of Trinidad and Tobago.