They are indeed similar in meaning, in practice.
The first "had" says that at the time of speaking, the fence has already been painted. It says nothing directly about the current state. It could for example have since been removed. (Though a little unlikely)
The second is a present tense/aspect, saying the fence is painted & that it was done recently.
So the first sentence gives a sense of a past action & its effect. It draws attention to the action being past.
The second sentence is entirely in the present, describing the present state.
Unless you want this subtle distinction, I guess they are close to equivalent.
The fence had been painted recently but had weathered quickly being exposed to the spray from the sea.
The fence is newly painted & will not need attention for a long time.