A heavily pregnant Muslim woman viciously attacked by a stranger at a Sydney cafe feared being killed if others did not intervene, a court has heard.