Two Brazilian maintenance workers died as a result of a toxic gas leak at an offshore oil rig operated by the state oil firm Petrobras.