if it is a 2.4L, will a 2.7L bolt right in?
In terms of compatible transmission/flexplate/flywheel/clutch, then yes.
Swapping in a 2.7 in place of a 2.4 will surely be much more simple than swapping the 3.4 for the 2.4.
I am not sure about the engine block width / placement of engine mounts of the 2RZ vs. the 3RZ.
I know the 2RZ uses different powersteering lines than the 3RZ. The Exhaust system will be nearly identical to one another (?)