Do your tail lights (and other lights) work when hooked up?
From the picture it appears you have two green wires coming from the trailer, one connected to the connector green wire and one connected to the connector brown wire. If that is the case I would guess the "repair place" added new (green) wires and used one to connect the tail lights to the brown connector wire. Bad brown wire somewhere under the trailer maybe? If that is the case, the loose brown wire is not needed. Look under the trailer and trace that loose brown wire. Likely you will find the other end not connected either.