The planes Ukraine currently has can only detect targets on radar within about a 30km radius. This is currently killing them, because they can't operate anywhere near the front to provide air support or otherwise russian missiles start flying at them and they can't see where they came from and they don't even see the missile on radar until it's too late
This isn't really correct. I've made some extensive (and dare I say informative) posts on this previously but to try and summarise.
The Su-27s Ukraine are using are not
as different to the planes Russia are using as you might think, you see during the mid 1990s Russia had the realisation that their plane/tank development had stalled due to being basically bankrupt and they were worried that export customers might stop buying their stuff as it was essentially stuff the USSR designed in the 80s. And so they had a great idea: "T-72BU you're now the T-90, MiG-29M2 you're now the MiG-35, Su-27PU you're now the Su-30, and Su-27M you're now the Su-35. Who wants to buy our new stuff!".
The point of this history lesson, is that some of Ukraine's Su-27s are modernized and upgraded versions of the planes that Russia modernised and upgraded to become the Su-30 and Su-35, and they're better maintained than Russia's to boot.
With that out of the way, the point I needed to explain that to make is that Ukraine's Su-27s and Russia's rebadged Su-27s are very evenly matched from an airframe/avionics point of view (Su-35s questionable thrust vectoring aside). They can both see each other on radar long before either can do anything about it. The problem is that Ukraine's Su-27s carry the Soviet R-27ET missile whereas Russia's carry the more modern R-77M missile, now both of these missiles are good for about 60 miles range but the problem is that the R-77 is an active "fire and forget" missile, you can get a lock, launch it and go home. The R-27 on the other hand is only semi active and needs a lock from the launching aircraft to be maintained. This is where Ukraine are struggling because they're simply a generation behind in the missile dept, even if they get the drop on the Russians and fire first they will have to break off and run when the Russian's fire back.
Ideally it would be awesome if somebody could get AMRAAMs working on the Su-27, but as this is a bit more complex than launching a pre-targeted cruise missile attached via a Tornado pylon it is logistically/technically a much simpler option to just give them F-16s to fire the AMRAAMs with.