No. Take $A=S^n$ and $X=X_1\vee X_2=S^n\vee S^n$. Let $f=2\vee (-1):S^n\rightarrow S^n\vee S^n$ be the sum of the degree $2$- and degree $-1$-self maps included into each respective factor. Now take $g=\nabla:S^n\vee S^n\rightarrow S^n$ to be the fold map. Then $g\circ f\simeq 2-1\simeq 1\simeq id_{S^n}$ so $S^n$ is homotopy dominated by $S^n\vee S^n$. However $S^n$ is indecomposable.