There is very little the anchored ship could have done to avoid the collision.
The ship underway should have a bridge team, especially when transiting a busy sea route.
The ship at anchor should have a watchkeeper to record regular bearing sightings to check ship is not dragging its anchor.