Let \( x \) be the amount of cargo unloaded at the Bahamas.
When the ship unloads \( x \) tons of cargo, the remaining cargo on the ship is:
\[ 5678 - x \]
Then, the crew loads three times the amount of cargo that was unloaded, which is:
\[ 3x \]
After loading this cargo, the total cargo on the ship becomes:
\[ (5678 - x) + 3x = 5678 + 2x \]
According to the problem, after these transactions, the total cargo on the ship is 8588 tons. Therefore, we can set up the following equation:
\[ 5678 + 2x = 8588 \]
Now, we will solve for \( x \) by first isolating \( 2x \):
\[ 2x = 8588 - 5678 \]
Calculating the right side:
\[ 2x = 2910 \]
Now, divide both sides by 2 to solve for \( x \):
\[ x = \frac{2910}{2} = 1455 \]
Thus, the amount of cargo that the ship unloaded at the Bahamas is:
\[ \boxed{1455} \text{ tons} \]