A vicious, video-recorded bathroom attack at Sunday’s 49ers game in Santa Clara happened after the main victim — who needed brain surgery, hasn’t spoken since and may be paralyzed — “nudged” one of the assailants on the shoulder to point out a free urinal, authorities said Wednesday.

Santa Clara County prosecutors revealed the details after filing assault charges against two men from the town of Traver in Tulare County: Jose Ramos, 27, who was said to be the chief attacker at Levi’s Stadium and is also known as Amador Rebollero, and 34-year-old Dario Rebollero. Both have long criminal histories, public records show.

The primary victim, who is 32, was hospitalized in critical condition with bleeding of the brain, and he underwent surgery to remove part of his skull to relieve swelling, according to a court affidavit by Santa Clara police. He has not been identified, nor has his cousin, who can be seen in the video trying to help, only to be punched in the head repeatedly by the two suspects.

The cousin told police he was in line for the bathroom before the 1:25 p.m. kickoff for the 49ers’ game against the Kansas City Chiefs when Ramos sucker-punched the 32-year-old victim, documents show. Ramos, who had been nudged, allegedly said he “doesn’t like getting pushed” before throwing three punches that sent the main victim to the hard floor, where he apparently hit his head.

During a brief court hearing in San Jose on Wednesday, a judge set Ramos’ bail at $350,000 because he allegedly provoked the attack, while Rebollero’s bail was set at $75,000. The men did not enter pleas and are due back in court Oct. 30.

“This was not a fight. This was an unprovoked and vicious attack against spectators that has left one of them close to death,” prosecutor Deborah Hernandez said in a statement. Outside court, she added, “We have two defendants who show no remorse. ... We will pursue this case to the fullest extent of the law."

Video of the assault — which showed all four men wearing 49ers gear in a crowded restroom — was posted on YouTube on Sunday by a witness but was later taken down because it violated the website’s policy on “shocking and disgusting content.”

The defendants have extensive criminal histories that have led to jail time, according to Tulare County records. Rebollero has a number of past convictions dating to 2001, including for assault with a deadly weapon, animal cruelty and hit and run. Ramos has been convicted of vehicle theft, drug possession and resisting police, among other crimes.

Libby Rainey and Evan Sernoffsky are San Francisco Chronicle staff writers. E-mail: lrainey@sfchronicle.com, esernoffsky@sfchronicle.com

Twitter: @rainey_l, @EvanSernoffsky