How did the largest/longest dinosaurs hold their head and necks up?
There are lots of papers on this. A good summary article is Why sauropods had long necks; and why giraffes have short necks, by Taylor​ and Wedel.  They list a number of anatomical features that allowed sauropods to support such long necks:


  Several anatomical features enabled this extreme elongation, including: absolutely large body size and quadrupedal stance providing a stable platform for a long neck; a small, light head that did not orally process food; cervical vertebrae that were both numerous and individually elongate; an efficient air-sac-based respiratory system; and distinctive cervical architecture. Relevant features of sauropod cervical vertebrae include: pneumatic chambers that enabled the bone to be positioned in a mechanically efficient way within the envelope; and muscular attachments of varying importance to the neural spines, epipophyses and cervical ribs. 


Let's take these one by one.


A stable platform for a long neck. Large, heavy quadrupedal bodies, so the long neck didn't unbalance the animal when it stretched out.
"A small, light head." Sauropods didn't chew their food, so didn't need large muscles or heavy bones in their head, so they didn't have a heavy weight at the far end of the long neck.
Numerous small, elongate cervical verterbrae. Sauropods had 12-19 vertebrae in their necks. By contrast, giraffes have seven, each of which needs to be large and heavy, limiting how long the neck can be.
Efficient respiratory system. Sauropods, like modern dinosaurs (birds) have a more efficient respiratory system than mammals, so they could tolerate the inefficiency of a long trachea.
Pneumaticity of cervical vertebrae Sauropod vertebrae had air sacs (i.e. hollow pockets of air) in them, making them much lighter than mammalian vertebrae of the same size and strength. 


Edit to add Figure 4 from Taylor &amp; Wedel, illustrating how relatively light sauropod necks must have been for their size: 




  Figure 4: Extent of soft tissue on ostrich and sauropod necks.
  1, Ostrich neck in cross section from Wedel (2003, figure 2). Bone is white, air-spaces are black, and soft tissue is grey. 2, Hypothetical sauropod neck with similarly proportioned soft-tissue. (Diplodocus vertebra silhouette modified from Paul, 1997, figure 4A). The extent of soft tissue depicted greatly exceeds that shown in any published life restoration of a sauropod, and is unrealistic. 3, More realistic sauropod neck. It is not that the soft-tissue is reduced but that the vertebra within is enlarged, and mass is reduced by extensive pneumaticity in both the bone and the soft-tissue.



Muscular attachments.  This is the aspect that most directly answers the original question, but it's first important to understand that other sauropod features as noted above allowed them to get away with less neck strength than you'd otherwise expect.  In fact sauropod necks were much less (relatively) muscled than, say, ostriches. They got away with this by improving mechanical advantage:



  In effect, sauropods inflated their vertebrae within the muscular envelope of the neck, moving the bone, muscle and ligament away from the centre so that they acted with greater mechanical advantage: higher epaxial tension members, lower hypaxial compression members, and more laterally positioned paraxials.


Taylor and Wedel go into this in much more detail, with many helpful diagrams, and the paper is open-access, so I won't repeat all their points here. They talk about neural spines, epipophyses, cervical ribs, and muscle attachments in various combinations. 

The cervical ribs are easily visible on the Patagotitan skeleton image in the question:



There's a long description of cervical rib anatomy and possible functions here:


  My favorite hypothesis is that long tendons allow an animal to shift the bulk of the muscle–and therefore the center of gravity–toward the base of the neck, but that long unossified tendons can be distorted through stretching, which wastes muscular energy. Ossifying those long tendons is like putting bony wheelbarrow handles on each vertebra, allowing the muscles to move the vertebra from a distance without so much wasted energy, and probably with finer positional control.


That's just one aspect of the way sauropod necks were structured.

TL;DR: Sauropod necks could afford to be relatively light, because of the small head; their neck bones tended to be relatively hollow and light for their size; their scale and shapes meant that muscles had good mechanical advantage; and different species had other adaptations including ligaments and stiffening bones that also helped.