These seem to be used in the same contexts a lot, but there are some cases where their usage differs.
試す - Trying something with the motive of discovering something's qualities.
試みる - Trying something without knowing what the result will be.
- Is seen used in more formal situations too.
So for these sentences, based on the goal it would change. 試す would show that you're constantly trying to figure out something, but it never goes your way perhaps. Such as testing a product for something. 試みる would be trying something out without knowing the end result, so like doing an experiment to test this product, but what sort of things will pop up are unknown.
Definitions I used are below!
This is just my own sort of feeling as well, so there may be some parts that are off, so I would love to hear other people's thoughts!
試す
Definition:
Google: 本当かどうか、それでよいかどうかなどを知ろう(確かめよう)と、実際にやってみる。
Actually trying to doing something, or checking if something is true / good.
Native Intuition (1): 対象となるものの性能・実態を知るためにやってみるというニュアンスが強い
Strong nuance of discovering something's true state or ability through trying to do something.
試みる
Definition:
Google:(実際に)どうなるかやってみる。ためしにやってみる。ためす。
Seeing how something turns out.
Native Intuition (1): 結果がどうなるかはわからないがとりあえずやってみるというニュアンスが強い
Not knowing how something will turn out, but trying it out anyways.