I think you should put many debug statements (Serial.print()) in the code, otherwise there are too many things that may go wrong and you'll never know.
First of all, however, how did you connect the modules to the Arduinos? From the picture I would say there is no exposed connection to the RESET or PIO11 pins of the module. Unless you made the connections yourself the code will not work, because it expects the module's RESET to be connected to the Arduino's pin5, and PIO11 to pin8. Additionally, if you have a Mega you cannot use SoftwareSerial on pins 6 and 7 (see this page: http://arduino.cc/en/Reference/SoftwareSerial
Then there may be problems at the software level, but you should first make sure that the hardware is properly setup.