I had a question regarding salah. Let’s say someone wanted to performe mustahab salah for the deceased, but did not pray or make up all of their obligatory salah. Would their prayer still be valid?

Yes their prayer on behalf of the deceased would be valid.