It sounds like you have a "heat soak" problem with the starter which is common on some engines or if the starter heat shields may been removed or none were ever installed. It happens on some engines with headers as well if the header tubes are too close to the starter or airflow is restricted such as in a boat engine bay. What happens is that when the engine heats up, the heat from the engine or exhaust headers soaks into the starter case and armature and causes the armature to expand and bind against the field coil which prevents the starter from turning when the engine is hot but it will work OK when the engine is cold. It's still a good idea to do tests on the battery cables to make sure they are not loose or corroded, etc.. and do a draw test on the starter.
Parts stores and performance shops, online sites, etc.. sell starter heat shields which can reflect that engine heat away from starter to reduce the heat soak problem or you can fabricate your own out of sheet aluminum if one is not available for your model/engine. Another trick is to wrap the starter case in "header tape" which keeps the starter cooler. Years ago, we had heat soak issues with some Chevy engines....we would remove/disassemble the starter and have a machine shop mill down the armature a couple thousandths to reduce binding.
It's also possible that the engine heat may cause a problem with the starter solenoid....high heat can cause internal resistance in the solenoid coil windings and prevent starting ...some guys resort to installing an exterior starter solenoid like Ford's use if heat shielding or a new solenoid does not fix the problem.
Heat soak issues....
https://www.google.com/search?q=chevy+heat+soak+issues+&oq=chevy+heat+soak+issues+&aqs=chrome.0.69i57.6603j0&sourceid=chrome&ie=UTF-8
Starter heat shields/wraps....
https://www.google.com/search?q=chevy+heat+soak+issues+&oq=chevy+heat+soak+issues+&aqs=chrome.0.69i57.6603j0&sourceid=chrome&ie=UTF-8#gs_rn=20&gs_ri=psy-ab&gs_mss=chevy%20heat%20soak%20issue&tok=W2qwNM7baa-HQ-CfwBQ7qA&pq=chevy%20heat%20soak%20issues%20&cp=12&gs_id=2r&xhr=t&q=starter+heat+shield&es_nrs=true&pf=p&safe=off&sclient=psy-ab&oq=starter+heat&gs_l=&pbx=1&bav=on.2,or.r_qf.&bvm=bv.49641647,d.aWc&fp=446d1a555c4ed1d6&biw=819&bih=522