To solve this problem, we first need to calculate the relative speed between the drone and the train. Since the drone is flying due west and the train is moving due east, the relative speed is the sum of their individual speeds.
- Speed of the drone \( v_{\text{drone}} = 10 \, \text{m/s} \) (westward),
- Speed of the train \( v_{\text{train}} = 20 \, \text{m/s} \) (eastward).
The relative speed between the drone and the train is:
\[
v_{\text{relative}} = v_{\text{drone}} + v_{\text{train}} = 10 + 20 = 30 \, \text{m/s}
\]
Now, the time taken for the drone to cross the train is given by the formula:
\[
t = \frac{\text{Distance}}{\text{Relative Speed}}
\]
The distance to be covered is the length of the train, which is 270 m. Thus, the time taken by the drone to cross the train is:
\[
t = \frac{270 \, \text{m}}{30 \, \text{m/s}} = 9 \, \text{s}
\]
Thus, the time taken by the drone to cross the train is \( 9 \, \text{s} \).