Gunmen attacked the state prosecutors’ office in this Caribbean resort city Tuesday, and authorities said four people were killed, ratcheting up tensions just a day after a shooting at a music festival in a nearby town left three foreigners and two Mexicans dead. It was too early to say if the attacks were linked, but they were a marked intrusion of bloodshed into Mexico’s main tourism zone, a region that had previously been spared much of the violence plaguing other parts of the country.