Fernando Alonso was given a penalty for causing a collision with Carlos Sainz during an intense battle for third place in the Chinese GP Sprint.