Yes, you would need the longer one
The one you have bought is incorrect as it's not ball and socket
You need to remove the metal clip by pushing it off, don't lose the clip, putting some masking tape on it helps
The cable should then twist out of the plastic holder
And then run the new one
I think the T section goes on the pedal side