The correct choice in this context is A: "Having just broken up."
The sentence would read: "Having just broken up with his girlfriend of two years, even the trees in the park looked sad."
This construction effectively indicates that the person's emotional state is a result of the recent breakup, linking his feelings to the description of the trees.