The OP asks:
But can you not be made righteous by following he law and doing sacrifices (which as far as I know are also part of the law)? If not, then why are Noah, Daniel, and Job called righteous?
Paul addresses this question in Galatians 3:
Galatians 3: 6-14 NIV
6 So also Abraham “believed God, and it was credited to him as righteousness.”
7 Understand, then, that those who have faith are children of Abraham. 8 Scripture foresaw that God would justify the Gentiles by faith, and announced the gospel in advance to Abraham: “All nations will be blessed through you.” 9 So those who rely on faith are blessed along with Abraham, the man of faith.
10 For all who rely on the works of the law are under a curse, as it is written: “Cursed is everyone who does not continue to do everything written in the Book of the Law.” 11 Clearly no one who relies on the law is justified before God, because “the righteous will live by faith.” 12 The law is not based on faith; on the contrary, it says, “The person who does these things will live by them.” 13 Christ redeemed us from the curse of the law by becoming a curse for us, for it is written: “Cursed is everyone who is hung on a pole.” 14 He redeemed us in order that the blessing given to Abraham might come to the Gentiles through Christ Jesus, so that by faith we might receive the promise of the Spirit.
Paul then argues that one of the reasons God gave the law was to lead us to Christ (Gal 3:15-24):
Galatians 3:15 15-19 NIV
15 Brothers and sisters, let me take an example from everyday life. Just as no one can set aside or add to a human covenant that has been duly established, so it is in this case. 16 The promises were spoken to Abraham and to his seed. Scripture does not say ‘and to seeds’, meaning many people, but ‘and to your seed’, meaning one person, who is Christ. 17 What I mean is this: the law, introduced 430 years later, does not set aside the covenant previously established by God and thus do away with the promise. 18 For if the inheritance depends on the law, then it no longer depends on the promise; but God in his grace gave it to Abraham through a promise.
19 Why, then, was the law given at all? It was added because of transgressions until the Seed to whom the promise referred had come.....
Galatians 3: 21- 22 NIV
21 Is the law, therefore, opposed to the promises of God? Absolutely not! For if a law had been given that could impart life, then righteousness would certainly have come by the law. 22 But Scripture has locked up everything under the control of sin, so that what was promised, being given through faith in Jesus Christ, might be given to those who believe.
Paul summarises:
Galatians 3:23-25 NIV
23Before the coming of this faith, we were held in custody under the law, locked up until the faith that was to come would be revealed. 24 So the law was our guardian until Christ came that we might be justified by faith. 25 Now that this faith has come, we are no longer under a guardian.
The law leads to Christ both by showing God's values and by demonstrating we can never be united with God through the law. “No one is justified before God by the law” (Galatians 3:11). The law illustrates our need in order to break us from the illusion that we can ever be justified by the law.
Paul elsewhere confirms that what matters to God is a covenant of the heart (Romans 2:29). That then was the origin of righteousness for Noah, Daniel and Job as raised by the OP. Righteousness, like faith, is of the heart.