The velocity of train A (\( V_A \)) is given as \( 90 \, \text{km/h} \), which can be converted to SI units:
\[
V_A = 90 \, \text{km/h} = 25 \, \text{m/s}.
\]
The velocity of train B (\( V_B \)) is given as \( 54 \, \text{km/h} \):
\[
V_B = 54 \, \text{km/h} = 15 \, \text{m/s}.
\]
Since the trains are moving in opposite directions, the relative velocity (\( V_{BA} \)) is the sum of their velocities:
\[
V_{BA} = V_A + V_B = 25 \, \text{m/s} + 15 \, \text{m/s} = 40 \, \text{m/s}.
\]
The time of crossing (\( t \)) is given as \( 8 \, \text{s} \). The length of train B (\( \ell \)) is related to the time of crossing and relative velocity as:
\[
t = \frac{\ell}{V_{BA}}.
\]
Substituting the values:
\[
8 = \frac{\ell}{40}.
\]
Solving for \( \ell \):
\[
\ell = 8 \times 40 = 320 \, \text{m}.
\]
Thus, the length of train B is \( \boxed{320 \, \text{m}} \).