When my hood latch cable broke a few years ago, I had to manually open the hood latch using a long screwdriver to reach up "BEHIND" the latch and trigger the release lever.
Once you do this, then you could install your battery and open the door with the key fob hopefully.
Later on I would highly recommend looking into why your key won't operate the lock/unlock mechanism on the door.
One video showed going through the grill with a socket and long extension and unbolting the hood latch. Never tried this myself, but I know that if you can get up behind the latch with a lever or screwdriver, you can release the hood lock latch.
You can watch this YouTube video, it shows how he did it a Jeep Cherokee, but the latch is the exact same as the one on the Jeep Liberty.
https://www.youtube.com/watch?v=K-cbBPXXBggGood luck.
_________________
Supporting Vendor and Moderator of LOST05 Jeep Liberty CRD Limited
Ironman Springs/Bilstein/Shocks
Yeti StgIV Hot Tune
Week's BatteryTray
No FCV/EGR
Samcos/ProVent
SunCoast/Transgo
Carter Intank-pmp
2mic.Sec.Fuel Filter
Flowmaster/NO CAT
V6Airbox/noVH
GM11 Bld.fan/HDClutch
IronrockArms/wwdieselMount98 Dodge Cummins 24 Valve