How to update the lineItemStatus of an order on the front end with twig?
You can use the same technique to set the line item data like this:
{% set order = craft.orders.id(123).one() %}

{% for lineItem in order.lineItems %}
    {% do lineItem.setAttributes({lineItemStatusId: 2}, false) %}
{% endfor %}

{% do order.setAttributes({
    orderStatusId: 4,
    lineItems: order.lineItems
}, false) %}

{% do craft.app.getElements().saveElement(order) %}

^ That would set all line items in an order to the same status... I imagine you have some kind of interface where you can either update a single line item at a time or mark several at once and press a submit button, so in that scenario you'll probably want to add some conditionals inside the loop to check that the line item id you're on matches say, the line item id passed in through the URL or through POST data or whatever so that just the right one(s) get updated