You cannot use the iMac as a Target Display for the Mac Studio. Target Display Mode went away when the first 27" 5K Retina iMac came out in Late 2014, and never returned. Current Macs don't support using ANY iMac as a Target Display.
You can connect the two to transfer data. There are ways to do that, some more expensive than others. One of the more expensive ways would be IP-over-Thunderbolt (Thunderbolt Bridge), using a $50 TB3-to-2 adapter and a $30 Thunderbolt 1/2 cable. That Thunderbolt connection wouldn't let you use the iMac as a display – and I think that for occasional data transfer, Wi-Fi/Ethernet/external drives would be a more cost-effective way to get things done.
If standalone 27" 5K (5120x2880 pixel) monitors from Apple, LG, and Samsung are priced out of your budget range, you could consider a 27" 4K monitor. Some basic ones sell for as little as $300 – $350. The best mode to run one in might be Retina "like 2560x1440" mode, but with 4K resolution, you'd be able to select other modes to make the text larger; or to cram a little more of it onto the screen.