Polynomial almost periodic solutions for a class of Riemann-Hilbert problems with triangular symbols