How can I detect if node is the last one from within node.tpl.php?
In general, it is not a good idea for Drupal objects to not "know" how they are being used on a page.  When you make them "self-aware" you introduce artificial dependencies that can make changes down the road harder to make, or inadvertently introduce bugs.

In you case, I would handle this in the views templates.  Out of the box, the last row should have a views-row-last class on it.

Otherwise, you need to implement a template_preprocess_node in your theme.  The view object will be available as $variables['view'].  You would need to add logic to check page, view name, etc, to make sure you are doing things in the right place.  Off the top of my head, I forget which properties you need to check; do a kpr($variables['view']) and poke around.