is this sentence correct? The new employees worked long hours, hoping doing so would advance their careers.

It's awkward having those two -ing verbs right next to each other. It would be better, too, to have that "hoping..." phrase closer to whoever/whatever it modifies ("employees" in this case). Try this:

Hoping to advance their careers, the new employees worked long hours.

Would this be a Ambiguous reference?

Yes, in the original sentence.

The sentence you provided is not grammatically correct. Here's the corrected version: "The new employees worked long hours, hoping that doing so would advance their careers."

To identify the grammar error in the original sentence, we can focus on the conjunction "hoping." After "hoping," we need to use the word "that" to introduce a subordinate clause, which explains the reason for their action.