Effective action for the Regge processes in QCD and in gravity