Are you judged based on your own actions or on the actions of those before you?
It seems that we are judged based on the conditions to which we were born:
אמרי אין מקבלים עליהן שכר כמצווה ועושה אלא כמי שאינו מצווה ועושה דא"ר חנינא גדול המצווה ועושה יותר ממי שאינו מצווה ועושה:
The Sages said in response: Rav Yosef meant that they do not receive the reward as does one who is commanded to perform a mitzva and performs it, but as does one who is not commanded to perform a mitzva and performs it anyway. As Rabbi Ḥanina says: One who is commanded and performs a mitzva is greater than one who is not commanded and performs it.
(ד) ויעתר לו לוֹ וְלֹא לָהּ, שֶׁאֵין דּוֹמָה תְפִלַּת צַדִּיק בֶּן צַדִּיק לִתְפִלַּת צַדִּיק בֶּן רָשָׁע, לְפִיכָךְ לוֹ וְלֹא לָהּ (יבמות ס"ד):
(4) ויעתר לו [AND THE LORD] WAS ENTREATED OF HIM — of him and not of her, because there is no comparison between the prayer of a righteous person who is the son of a righteous person and the prayer of a righteous person the child of a wicked-person — therefore God allowed himself to be entreated of him and not of her (Yevamot 64a).
Conversely, the Torah seems to emphasize the role our individual effort plays in our judgement:
(יב) רַבִּי יוֹסֵי אוֹמֵר,... וְהַתְקֵן עַצְמְךָ לִלְמֹד תּוֹרָה, שֶׁאֵינָהּ יְרֻשָּׁה לָךְ
(12) Rabbi Yosi says: ... Prepare yourself to study Torah, for it is not an inheritance for you
ופליגא דר' אבהו דא"ר אבהו מקום שבעלי תשובה עומדין צדיקים גמורים אינם עומדין שנאמר (ישעיהו נז, יט) שלום שלום לרחוק ולקרוב לרחוק ברישא והדר לקרוב
And the Gemara notes that this statement disagrees with the opinion of Rabbi Abbahu who holds that penitents are superior to the righteous. As Rabbi Abbahu said: In the place where penitents stand, even the full-fledged righteous do not stand, as it is stated: “Peace, peace upon him who is far and him who is near.” Peace and greeting is extended first to him who is far, the penitent, and only thereafter is peace extended to him who is near, the full-fledged righteous.
And then there seems to be a grey area:
(ז) נֹצֵ֥ר חֶ֙סֶד֙ לָאֲלָפִ֔ים נֹשֵׂ֥א עָוֺ֛ן וָפֶ֖שַׁע וְחַטָּאָ֑ה וְנַקֵּה֙ לֹ֣א יְנַקֶּ֔ה פֹּקֵ֣ד ׀ עֲוֺ֣ן אָב֗וֹת עַל־בָּנִים֙ וְעַל־בְּנֵ֣י בָנִ֔ים עַל־שִׁלֵּשִׁ֖ים וְעַל־רִבֵּעִֽים׃
(7) extending kindness to the thousandth generation, forgiving iniquity, transgression, and sin; yet He does not remit all punishment, but visits the iniquity of parents upon children and children’s children, upon the third and fourth generations.”
(ה) פקד עון אבות על בנים. כְּשֶׁאוֹחֲזִים מַעֲשֵׂה אֲבוֹתֵיהֶם בִּידֵיהֶם, שֶׁכְּבָר פֵּרַשׁ בְּמִקְרָא אַחֵר לְשֹׂנְאָי (שמות כ'):
(5) פקד עון אבות על בנים VISITING THE INIQUITY OF THE FATHERS UPON THE CHILDREN — when they retain in their hands (follow the example of) the evil doings of their ancestors. This must be the meaning because in another verse of a similar character it has already been stated: of them that hate Me (cf. Exodus 20:5: Visiting the iniquity of fathers upon the children, upon the third and fourth generation of them that hate Me (Berakhot 7a; Sanhedrin 27b).
(ו) ועל רבעים. דּוֹר רְבִיעִי; נִמְצֵאת מִדָּה טוֹבָה מְרֻבָּה עַל מִדַּת פּוּרְעָנוּת אַחַת לַחֲמֵשׁ מֵאוֹת, שֶׁבַּמִדָּה טוֹבָה הוּא אוֹמֵר נֹצֵר חֶסֶד לָאֲלָפִים (תוספתא סוטה ד'):
(6) ועל רבעים means AND UPON THE FOURTH GENERATION — It follows, therefore, that the measure of good (reward) is greater than the measure of punishment in the proportion of one to five hundred, for in respect to the measure of good it says: “Keeping mercy for thousands” (two thousands at least) (cf. Rashi above: Tosefta Sotah 4:1; see also Rashi on Exodus 20:5).
למשפחת מנשה בן יוסף. לָמָּה נֶאֱמַר? וַהֲלֹא כְבָר נֶאֱמַר בן מנשה, אֶלָּא לוֹמַר לְךָ, יוֹסֵף חִבֵּב אֶת הָאָרֶץ, שֶׁנֶּאֱמַר "וְהַעֲלִתֶם אֶת עַצְמֹתַי" וְגוֹ' (בראשית נ') וּבְנוֹתָיו חִבְּבוּ אֶת הָאָרֶץ, שֶׁנֶּאֱמַר תְּנָה לָּנוּ אֲחֻזָּה, וּלְלַמֶּדְךָ שֶׁהָיוּ כֻלָּם צַדִּיקִים, שֶׁכָּל מִי שֶׁמַּעֲשָׂיו וּמַעֲשֵׂה אֲבוֹתָיו סְתוּמִים וּפֵרֵט לְךָ הַכָּתוּב בְּאֶחָד מֵהֶם לְיַחֲסוֹ לְשֶׁבַח, הֲרֵי זֶה צַדִּיק בֶּן צַדִּיק, וְאִם יִחֲסוֹ לִגְנַאי, כְּגוֹן "בָּא יִשְׁמָעֵאל בֶּן נְתַנְיָה בֶּן אֱלִישָׁמָע" (מלכים ב כ"ה), בְיָדוּעַ שֶׁכָּל הַנִּזְכָּרִים עִמּוֹ רְשָׁעִים הָיוּ (ספרי):
למשפחת מנשה בן יוסף OF THE FAMILIES OF MANASSEH THE SON OF JOSEPH — Why is this stated? Has it not already been said בן מנשה, and consequently we know that they belonged to the family of Manasseh the son of Joseph?! But it is to suggest the following idea to you: Just as Joseph held the Promised Land dear, as it is said, (Genesis 50:25) “And ye shall bring my bones up (to Palestine) from hence”, so, too, his daughters held the Land dear, as it is said, (v. 4) “Give us an inheritance”; and further to teach you that they were righteous all of them (everyone here mentioned in the pedigree), for in every case where a person’s doings and his ancestors’ doings are nowhere plainly described and Scripture somewhere enters into the details of the pedigree in respect to one of them, tracing his genealogy back to someone worthy of praise, it is evident that the person in question is himself a righteous man and a son of a righteous father. But if it gives his genealogy in connection with something deserving of reprobation, — as, for example, (2 Kings 25:25) “Ishmael the son of Nethanian the son of Elishama came … and smote Gedaliah”, then it is quite certain that all who are mentioned in connection with him were wicked people (Sifrei Bamidbar 133:1).

