Inclusive photo- and electroproduction of pions in the triple Regge region