Tropical Storm Imelda has formed with conditions expected to bring torrential tropical rainfall to the Bahamas and Cuba.