And as far as the engineer for that episode goes. It was never stated that that lady was the chief engineer. She could have been a "chief" in the same way that O'Brien was. Remember that was his title on TNG, and he wasn't the chief engineer. The woman could have been in charge simply because Scotty was off-duty.
Charlene Masters was never addressed as "chief" at any point in the episode -- only as "Lieutenant." Not to mention that she wore a blue science-department uniform rather than a red engineering uniform. And she had no rank stripes, which would've been more consistent with an ensign or enlisted crewperson.
Nor was there ever any indication that she was in charge of engineering as a whole. She seemed to be the senior officer in the particular subsection of the engineering complex that was responsible for the dilithium circuits, but that's all.
O'Brien was called "chief" because it's short for his enlisted rating, chief petty officer.