Lords Mobile app was purchased with an old AppleID. Would the game data be lost if I re-purchase the app using a new AppleID?
It depends on how the app stores data, which can either be locally to the installation, in the game company's server, in iCloud Disk, or in iCloud Data (or furthmore in GameCenter's APIs for game data which are variations of the previous).
Stored on the game's server
If you created a login for the game, odds are your progress is stored on their server and you might be able to test by downloading the game on a second device and see if if your progress is maintained.
Usually, Gems or other "premium" currencies that you paid for with real-world money are not transferable between OSs (Gems bought on Android do not transfer to an iPhone, and vice versa).
If you use separate AppleIDs for your iCloud and App/iTunes Store logins, then app data might well be already in your expected iCloud storage.
If you utilize the "offload app" feature mentioned in the comment by Ihf, then you stand a little safer, as the local data should not be removed, only the application data. Go to the Settings App > iPhone/iPad Storage then either enable the global Offload Unused Apps or scroll down the list and "offload" the specific app you want to save space from.
Note, because this usually only removes the application and not cached data, if your game utilizes a download phase before you play it (like when your first downloaded the app, and then again when they update content) then you may not see much storage space freed up by this method, since your device is retaining local files.
Pay attention to an app's "App Size" vs it's "Documents & Data" in the Offload settings list. Garage Band on my iPhone consumes over 3GB, 1.5GB in the App, and 1.8GB in Documents and Data. Offloading would only free up the 1.5GB of the App itself.
Also note, the global "Offload Unused Apps" feature might be a little to aggresive for some needs. I've had some apps I use daily or weekly get swept into the list to be offloaded, and you need to have access to the internet in order to relaunch them after being offloaded, since in effect you need to re-download them from the AppStore (albeit, without having to launch the AppStore).
Offloaded apps will display a cloud download icon in their name on the home-screen so you can see at a glance which ones have been removed to free up space.