I've found strength training with bodyweight exercises to help immensely with both. I'm following the "recommended routine" from the /r/bodyweightfitness subreddit. [1]
On hamstring tightness: often when muscles are tight, it's due to a strength imbalance. Runners tend to get tight hamstrings because they work their quads a lot and the hamstrings don't keep up. So while it's a bit of an oversimplification to say that if certain muscles are chronically tight, you can fix that just by making them stronger, it's not too far off. For me it was really that simple: strengthening my hamstrings with hip hinges [2] made them noticeably less tight within about a month.
For posture it's basically the same idea. I always thought posture was like a force of will/discipline/habit thing until I finally felt how much easier it is to have that "discipline" after moderately strengthening my back, chest, core, and legs. Standing or sitting up straight is actually a lot of work for our bodies. And if it's basically the hardest thing you regularly subject the relevant muscles to, it's not too surprising that they will get tired out quickly. But if you start doing things that are much harder for each muscle group (like planks, push ups, rows, squats, hinges, etc.), then simply holding yourself up straight gets much easier.