There are a few things.
Firstly, you are using a Mega, which has 4 UARTs (hwSerial ports) and you should use one of those instead of swSerial.
Secondly, you will need to make sure you do not exceed the 3.3v logic level of the ESP-01 on it's RX line using either a voltage divider or level shifter. Since you've swapped RX & TX to try and resolve your issue, it is possible you have damaged your ESP.
Most ESP-01s come with AT-firmware that runs at 115200, Since swSerial is not reliable for reception at 115200, normally one would first send the command to change the baudrate to 9600 on the ESP.
When using hwSerial, you will not have that issue.
Show us your circuit schematic.
Oh yes, and make sure that you have 'line ending' set to 'Both CR & LF' in the Serial monitor, or the ESP will not respond properly.