If a team bats out of turn, the onus is not on the umpires to notify either team of the transgression. The consequences of batting out of turn vary depending on the timing of the appeal.
Appeal made during plate appearance
If the opposing team makes its appeal or the offensive team realizes its error before the incorrect batter's plate appearance has concluded, then the correct batter can take his place at bat while assuming the incorrect batter's count.
Appeal made following plate appearance but before next pitch or attempted play
If the appeal occurs between the conclusion of the incorrect batter's plate appearance but before the next pitch or attempted play, the correct batter is called out. Furthermore, any score or advancement caused by the incorrect batter batting a ball or reaching first base is nullified.
However, scores or advancements are counted if they occur as a result of a stolen base, balk, wild pitch or passed ball during the incorrect batter's plate appearance.
Appeal made following plate appearance and after next pitch or attempted play
If no appeal is made before the next pitch or attempted play following the conclusion of the incorrect batter's plate appearance, the incorrect batter is now considered to have batted in turn and all scores or advancements made during or as a result of his plate appearance are counted. The offensive team continues batting in its designated order from that point and places the skipped batter back into his original lineup spot the next time around.
Watch: The Giants' Buster Posey bats out of turn in place of Pablo Sandoval, who is ruled out after the Dodgers appeal.